Documentation ¶
Index ¶
- Constants
- Variables
- type DirectorySpool
- func (d *DirectorySpool) Complete(m *Message) error
- func (d *DirectorySpool) Discard(m *Message) error
- func (d *DirectorySpool) IncrementTries(m *Message) error
- func (d *DirectorySpool) NewMessage() *Message
- func (d *DirectorySpool) StartPoll(ctx context.Context, wg *sync.WaitGroup, handler func([]*Message) error) error
- func (d *DirectorySpool) Submit(msg *Message) error
- type Message
- type Option
- type Spool
- type Store
- type StoreType
- type Submitter
Constants ¶
View Source
const ( HdrNatsMsgId = "Nats-Msg-Id" HdrChoriaPriority = "Choria-Priority" HdrChoriaCreated = "Choria-Created" HdrChoriaSender = "Choria-Sender" HdrChoriaReliable = "Choria-Reliable" HdrChoriaTries = "Choria-Tries" HdrChoriaIdentity = "Choria-Identity" HdrChoriaToken = "Choria-Token" HdrChoriaSignature = "Choria-Signature" HdrChoriaPrefix = "choria" HdrNatsPrefix = "nats" )
Variables ¶
View Source
var ( ErrMessageExpired = errors.New("message has expired") ErrMessageMaxTries = errors.New("message reached maximum tries") ErrSeedFileNotSet = errors.New("seed file not set to sign message") ErrSeedFileNotFound = errors.New("seed file not found") ErrSignatureFailed = errors.New("could not calculate message signature") ErrReservedHeaderName = errors.New("headers may not start with 'choria' or 'nats'") )
Functions ¶
This section is empty.
Types ¶
type DirectorySpool ¶
type DirectorySpool struct {
// contains filtered or unexported fields
}
func NewDirectorySpool ¶
func (*DirectorySpool) Complete ¶
func (d *DirectorySpool) Complete(m *Message) error
func (*DirectorySpool) Discard ¶
func (d *DirectorySpool) Discard(m *Message) error
func (*DirectorySpool) IncrementTries ¶
func (d *DirectorySpool) IncrementTries(m *Message) error
func (*DirectorySpool) NewMessage ¶
func (d *DirectorySpool) NewMessage() *Message
func (*DirectorySpool) Submit ¶
func (d *DirectorySpool) Submit(msg *Message) error
type Message ¶
type Message struct { ID string `json:"id"` Subject string `json:"subject"` Payload []byte `json:"payload"` Reliable bool `json:"reliable"` Priority uint `json:"priority"` Created time.Time `json:"created"` TTL float64 `json:"ttl"` MaxTries uint `json:"max_tries"` Tries uint `json:"tries"` NextTry time.Time `json:"next_try"` Sender string `json:"sender"` Identity string `json:"identity"` Sign bool `json:"sign"` Headers map[string]string `json:"headers"` // contains filtered or unexported fields }
func (*Message) NatsMessage ¶
type Option ¶
type Option func(o *spoolOpts)
func WithMaxSpoolEntries ¶
WithMaxSpoolEntries sets the maximum amount of entries allow in the spool, new entries will be rejected
func WithSeedFile ¶ added in v0.27.0
WithSeedFile sets the ed25519 seed to use which will enable signed messages
func WithSpoolDirectory ¶
WithSpoolDirectory sets the path to the directory for the Directory store
func WithTokenFile ¶ added in v0.27.0
WithTokenFile sets the JWT file to use, when set will set it as a header in signed messages
type Spool ¶
type Spool struct {
// contains filtered or unexported fields
}
func (*Spool) NewMessage ¶
Click to show internal directories.
Click to hide internal directories.