Documentation
¶
Index ¶
- Variables
- func Run(ctx context.Context) error
- func UnixToTime(msec int64) time.Time
- type CLI
- type ConfirmationCommandBase
- type CreateQueueCommand
- type DeleteMessageCommand
- type DeleteQueueCommand
- type ErrNotFound
- type GetQueueCommand
- type ListQueueCommand
- type Message
- type MessageCommand
- type MessageCountCommand
- type ModifyQueueCommand
- type PurgeQueueCommand
- type QueueCommand
- type QueueCommandBase
- type ReceiveMessageCommand
- type RotateAPIKeyCommand
- type SendMessageCommand
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "v0.9.3"
Functions ¶
func UnixToTime ¶
Types ¶
type CLI ¶
type CLI struct {
Version kong.VersionFlag `short:"v" help:"Show version and exit."`
Debug bool `help:"Enable debug mode." env:"SIMPLEMQ_DEBUG" default:"false"`
Timeout time.Duration `help:"Timeout for API requests (e.g. 30s, 1m)." env:"SIMPLEMQ_TIMEOUT"`
Message *MessageCommand `cmd:"" help:"Message related commands"`
Queue *QueueCommand `cmd:"" help:"Queue related commands"`
// contains filtered or unexported fields
}
type ConfirmationCommandBase ¶ added in v0.1.0
type ConfirmationCommandBase struct {
Force bool `help:"Force operation without confirmation prompt" short:"f" default:"false" env:"SIMPLEMQ_FORCE"`
}
type CreateQueueCommand ¶ added in v0.1.0
type CreateQueueCommand struct {
QueueCommandBase
Description string `help:"Description of the queue"`
}
type DeleteMessageCommand ¶ added in v0.1.0
type DeleteMessageCommand struct {
MessageID string `arg:"" help:"ID of the message to delete" name:"message-id"`
}
type DeleteQueueCommand ¶ added in v0.1.0
type DeleteQueueCommand struct {
QueueCommandBase
ConfirmationCommandBase
}
type ErrNotFound ¶ added in v0.0.4
type ErrNotFound struct {
Message string
}
func (ErrNotFound) Error ¶ added in v0.0.4
func (e ErrNotFound) Error() string
type GetQueueCommand ¶ added in v0.1.0
type GetQueueCommand struct {
QueueCommandBase
}
type ListQueueCommand ¶ added in v0.1.0
type ListQueueCommand struct{}
type Message ¶
type Message struct {
ID string `json:"id"`
Content string `json:"content"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ExpiresAt time.Time `json:"expires_at"`
AcquiredAt time.Time `json:"acquired_at"`
VisibilityTimeoutAt time.Time `json:"visibility_timeout_at"`
}
type MessageCommand ¶
type MessageCommand struct {
QueueName string `name:"queue" help:"Queue name" short:"q" required:"" env:"SIMPLEMQ_QUEUE_NAME"`
APIKey string `help:"API Key" required:"" env:"SIMPLEMQ_API_KEY"`
MessageAPIURL string `help:"Message API URL (deprecated: use SAKURA_ENDPOINTS_SIMPLE_MQ_MESSAGE instead)" env:"SIMPLEMQ_MESSAGE_API_URL"`
Raw bool `help:"Handle raw message without Base64 encoding/decoding" default:"false" env:"SIMPLEMQ_RAW"`
Send *SendMessageCommand `cmd:"" help:"Send message to queue"`
Receive *ReceiveMessageCommand `cmd:"" help:"Receive message from queue"`
Delete *DeleteMessageCommand `cmd:"" help:"Delete message from queue"`
}
type MessageCountCommand ¶ added in v0.1.0
type MessageCountCommand struct {
QueueCommandBase
}
type ModifyQueueCommand ¶ added in v0.1.0
type ModifyQueueCommand struct {
QueueCommandBase
VisibilityTimeoutSeconds *int64 `help:"Visibility timeout in seconds"`
ExpireSeconds *int64 `help:"Message expire time in seconds"`
}
type PurgeQueueCommand ¶ added in v0.1.0
type PurgeQueueCommand struct {
QueueCommandBase
ConfirmationCommandBase
}
type QueueCommand ¶ added in v0.1.0
type QueueCommand struct {
Create *CreateQueueCommand `cmd:"" help:"Create a new queue"`
List *ListQueueCommand `cmd:"" help:"List queues"`
Get *GetQueueCommand `cmd:"" help:"Get queue details"`
Modify *ModifyQueueCommand `cmd:"" help:"Modify queue settings"`
Delete *DeleteQueueCommand `cmd:"" help:"Delete a queue"`
MessageCount *MessageCountCommand `cmd:"" help:"Get message count in a queue"`
RotateAPIKey *RotateAPIKeyCommand `cmd:"" help:"Rotate API key for a queue"`
Purge *PurgeQueueCommand `cmd:"" help:"Purge all messages in a queue"`
}
type QueueCommandBase ¶ added in v0.1.0
type QueueCommandBase struct {
QueueName string `name:"queue" help:"Queue name" short:"q" env:"SIMPLEMQ_QUEUE_NAME"`
QueueID string `name:"queue-id" help:"Queue ID (skip name resolution if specified)" env:"SIMPLEMQ_QUEUE_ID"`
}
func (*QueueCommandBase) Validate ¶ added in v0.6.0
func (b *QueueCommandBase) Validate() error
type ReceiveMessageCommand ¶ added in v0.1.0
type ReceiveMessageCommand struct {
Polling bool `help:"Enable polling to receive message" default:"false" env:"SIMPLEMQ_POLLING"`
Count int `help:"Number of messages to receive" default:"1" env:"SIMPLEMQ_RECEIVE_COUNT"`
AutoDelete bool `help:"Automatically delete messages after receiving" default:"false" env:"SIMPLEMQ_AUTO_DELETE"`
Interval time.Duration `help:"Polling interval for receiving message" default:"1s" env:"SIMPLEMQ_POLLING_INTERVAL"`
}
type RotateAPIKeyCommand ¶ added in v0.1.0
type RotateAPIKeyCommand struct {
QueueCommandBase
ConfirmationCommandBase
}
type SendMessageCommand ¶ added in v0.1.0
type SendMessageCommand struct {
Content string `arg:"" optional:"" help:"Content of the message to send. if - read from stdin" name:"content"`
Stdin bool `help:"Read message content from stdin" xor:"input"`
File string `help:"Read message content from a file" name:"file" type:"existingfile" xor:"input"`
EachLine bool `help:"Send each line as a separate message (requires --stdin or --file)" default:"false" name:"each-line"`
EachJSON bool `help:"Send each JSON value as a separate message (requires --stdin or --file)" default:"false" name:"each-json"`
}
func (*SendMessageCommand) Validate ¶ added in v0.8.0
func (cmd *SendMessageCommand) Validate() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.