broker

package
v0.0.0-...-7febb3a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromFile

func NewFromFile(file string) (*loadStatus, error)

Types

type Client

type Client struct {
	ClientId         string `json:"client_id"`
	Active           bool   `json:"active"`
	LastSequenceSent int64  `json:"last_sequence_sent"`
	IsStalled        bool   `json:"is_stalled"`
	Pending          int64  `json:"pending"`
}

type HealthNotifier

type HealthNotifier struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewHealthNotifier

func NewHealthNotifier() *HealthNotifier

func (*HealthNotifier) Register

func (hn *HealthNotifier) Register(name string, sub func(state bool))

func (*HealthNotifier) Send

func (hn *HealthNotifier) Send(value bool)

func (*HealthNotifier) UnRegister

func (hn *HealthNotifier) UnRegister(name string)

type HealthState

type HealthState struct {
	IsHealthy bool `json:"is_healthy"`
	IsReady   bool `json:"is_ready"`
}

type Queue

type Queue struct {
	Name          string `json:"name"`
	Messages      int64  `json:"messages"`
	Bytes         int64  `json:"bytes"`
	FirstSequence int64  `json:"first_sequence"`
	LastSequence  int64  `json:"last_sequence"`
	Sent          int64  `json:"sent"`
	Subscribers   int    `json:"subscribers"`
	Waiting       int64  `json:"waiting"`
	Delivered     int64  `json:"delivered"`
	// contains filtered or unexported fields
}

func (*Queue) Calc

func (q *Queue) Calc()

type Queues

type Queues struct {
	Now         time.Time `json:"now"`
	TotalQueues int       `json:"total_queues"`
	Sent        int64     `json:"sent"`
	Waiting     int64     `json:"waiting"`
	Delivered   int64     `json:"delivered"`
	Queues      []*Queue  `json:"queues"`
}

func (*Queues) Filter

func (q *Queues) Filter(exp string) *Queues

type Service

type Service struct {
	NatsOptions  *natsd.Options
	SnatsOptions *snats.Options

	Nats    *natsd.Server
	Snats   *snats.StanServer
	Stopped chan struct{}
	// contains filtered or unexported fields
}

func New

func New(appConfig *config.Config) *Service

func (*Service) Close

func (s *Service) Close()

func (*Service) DisableMetricsReporting

func (s *Service) DisableMetricsReporting()

func (*Service) GetEventsStores

func (s *Service) GetEventsStores(ctx context.Context) (*Queues, error)

func (*Service) GetQueues

func (s *Service) GetQueues(ctx context.Context) (*Queues, error)

func (*Service) HealthState

func (s *Service) HealthState() *HealthState

func (*Service) IsHealthy

func (s *Service) IsHealthy() bool

func (*Service) IsReady

func (s *Service) IsReady() bool

func (*Service) RegisterToNotifyState

func (s *Service) RegisterToNotifyState(name string, sub func(state bool))

func (*Service) Start

func (s *Service) Start(ctx context.Context) (*Service, error)

func (*Service) UnRegisterToNotifyState

func (s *Service) UnRegisterToNotifyState(name string)

type State

type State int8
const (
	Standalone State = iota
)

Jump to

Keyboard shortcuts

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