nats

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func GetExistingSchedules

func GetExistingSchedules()

func GetKeyValue

func GetKeyValue(key string) ([]byte, error)

func JetstreamConnect

func JetstreamConnect(parentContext context.Context, parentLogger *slog.Logger, parentConfig *config.HatsConfig) error

func KvConnect

func KvConnect() error

func Publish

func Publish(subject string, message []byte)

func PublishRequest added in v0.16.0

func PublishRequest(subject string, message []byte, timeout time.Duration, retries int)

func PublishString

func PublishString(subject, message string)

func ScheduleStoreConnect

func ScheduleStoreConnect() error

func SetKeyValue

func SetKeyValue(key string, value []byte) error

func SetKeyValueString

func SetKeyValueString(key, value string) error

func StopSchedules

func StopSchedules()

Types

type HatsSchedule

type HatsSchedule struct {
	Name string
	Cron string
}

func GetSchedule

func GetSchedule(name string) (*HatsSchedule, error)

func NewSchedule

func NewSchedule(name, cron string) *HatsSchedule

func (*HatsSchedule) Activate

func (t *HatsSchedule) Activate() error

func (*HatsSchedule) Cancel

func (t *HatsSchedule) Cancel()

func (*HatsSchedule) GetNext

func (t *HatsSchedule) GetNext() string

type HatsTimer

type HatsTimer struct {
	Name       string
	State      string
	Duration   time.Duration
	FinishTime time.Time
}

func GetTimer

func GetTimer(name string) (*HatsTimer, error)

func (*HatsTimer) Activate

func (t *HatsTimer) Activate(durationOverride string)

func (*HatsTimer) ActivateIfNotAlready

func (t *HatsTimer) ActivateIfNotAlready(durationOverride string)

func (*HatsTimer) Cancel

func (t *HatsTimer) Cancel()

func (*HatsTimer) ToString

func (t *HatsTimer) ToString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL