Documentation
¶
Index ¶
- Constants
- func MustInitSnowflake(node int64)
- type DashboardStats
- type Envelope
- func (e *Envelope) AddHeader(key string, value string)
- func (e *Envelope) HeadersBytes() ([]byte, error)
- func (e *Envelope) IDString() string
- func (e *Envelope) Log() *slog.Logger
- func (e *Envelope) PayloadBytes() ([]byte, error)
- func (e *Envelope) Verify() error
- func (e *Envelope) WithGroup(group string) *Envelope
- func (e *Envelope) WithPayload(payload []byte) *Envelope
- func (e *Envelope) WithTag(tag any) *Envelope
- type MessageFilter
- type MessageStats
- type Pagination
Constants ¶
View Source
const ( MaxPageSize int = 200 DefPageSize int = 20 )
Variables ¶
This section is empty.
Functions ¶
func MustInitSnowflake ¶
func MustInitSnowflake(node int64)
Types ¶
type DashboardStats ¶
type DashboardStats struct {
Published MessageStats `json:"published"`
Received MessageStats `json:"received"`
}
type Envelope ¶
type Envelope struct {
ID uint
CreatedAt time.Time
Headers map[string]string
Version string
Topic string
Group string
Status enum.Status
Message any
Payload []byte
Retries int
Tag any
Logger *slog.Logger
}
func (*Envelope) HeadersBytes ¶
func (*Envelope) PayloadBytes ¶
func (*Envelope) WithPayload ¶
type MessageFilter ¶
type MessageStats ¶
type MessageStats struct {
Total int64 `json:"total"`
Pending int64 `json:"pending"`
Processing int64 `json:"processing"`
Succeeded int64 `json:"succeeded"`
Failed int64 `json:"failed"`
Retries int64 `json:"retries"`
LastActivity *time.Time `json:"lastActivity"`
OldestBacklog *time.Time `json:"oldestBacklog"`
}
type Pagination ¶
func NewPagination ¶
func NewPagination(page int, perPage int) *Pagination
NewPagination constructs a new instance of type Pagination
func (Pagination) MarshalJSON ¶
func (p Pagination) MarshalJSON() ([]byte, error)
MarshalJSON serializes type Pagination to json bytes
func (*Pagination) Normalize ¶
func (p *Pagination) Normalize() Pagination
func (*Pagination) SetTotal ¶
func (p *Pagination) SetTotal(total int)
func (Pagination) ShootNew ¶
func (p Pagination) ShootNew()
ShootNew exists solely to fulfill the NewShooter interface contract
func (*Pagination) UnmarshalJSON ¶
func (p *Pagination) UnmarshalJSON(data []byte) error
UnmarshalJSON deserializes json bytes to type Pagination
Click to show internal directories.
Click to hide internal directories.