Documentation
¶
Index ¶
- func MergeConfig(cfg *config.ConfYaml, opts *Options) error
- func NewQueuePool(cfg *config.ConfYaml, w qcore.Worker) *queue.Queue
- func NewQueueWorker(cfg *config.ConfYaml) (qcore.Worker, error)
- func SendAndroidNotification(ctx context.Context, cfg *config.ConfYaml, opts CLISendOptions) error
- func SendHuaweiNotification(ctx context.Context, cfg *config.ConfYaml, opts CLISendOptions) error
- func SendIOSNotification(ctx context.Context, cfg *config.ConfYaml, opts CLISendOptions) error
- func SendNotification(ctx context.Context, platform int, cfg *config.ConfYaml, opts CLISendOptions) error
- func ValidateAndMerge(opts *Options) (*config.ConfYaml, error)
- type CLISendOptions
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeConfig ¶
MergeConfig merges CLI options into the configuration. CLI options take precedence over config file values.
func NewQueuePool ¶
NewQueuePool creates a queue pool with the configured number of workers.
func NewQueueWorker ¶
NewQueueWorker creates a queue worker based on the configured queue engine. Supported engines: local, nsq, nats, redis.
func SendAndroidNotification ¶
SendAndroidNotification sends an Android notification via CLI.
func SendHuaweiNotification ¶
SendHuaweiNotification sends a Huawei notification via CLI.
func SendIOSNotification ¶
SendIOSNotification sends an iOS notification via CLI.
func SendNotification ¶
func SendNotification( ctx context.Context, platform int, cfg *config.ConfYaml, opts CLISendOptions, ) error
SendNotification sends a notification based on platform type.
Types ¶
type CLISendOptions ¶
CLISendOptions contains options for sending notifications via CLI.
type Options ¶
type Options struct {
ShowVersion bool
Ping bool
ConfigFile string
// Notification options (for CLI mode)
Token string
Message string
Title string
Topic string
// Config overrides
Conf config.ConfYaml
}
Options holds all CLI flag values.
func NewOptions ¶
func NewOptions() *Options
NewOptions creates a new Options instance with default values.
func (*Options) BindFlags ¶
func (o *Options) BindFlags()
BindFlags binds CLI flags to the Options struct. Call this before flag.Parse().
func (*Options) CLISendOptions ¶
func (o *Options) CLISendOptions() CLISendOptions
CLISendOptions returns CLI send options for notification sending.