client

package
v2.24.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResourceTypeFilterString added in v2.22.0

func CheckResourceTypeFilterString(s string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(config Config, fileWatcher *fsnotify.Watcher, logger log.Logger) (*Client, error)

func (*Client) AddCloseFunc

func (c *Client) AddCloseFunc(f func())

func (*Client) Close

func (c *Client) Close()

func (*Client) GetConn

func (c *Client) GetConn() *nats.Conn

type Config

type Config struct {
	URL            string              `yaml:"url" json:"url"`
	FlusherTimeout time.Duration       `yaml:"flusherTimeout" json:"flusherTimeout"`
	PendingLimits  PendingLimitsConfig `yaml:"pendingLimits" json:"pendingLimits"`
	TLS            client.Config       `yaml:"tls" json:"tls"`
	Options        []nats.Option       `yaml:"-" json:"-"`
}

func (*Config) Validate

func (c *Config) Validate() error

type ConfigPublisher

type ConfigPublisher struct {
	Config           `yaml:",inline" json:",inline"`
	JetStream        bool                             `yaml:"jetstream" json:"jetstream"`
	LeadResourceType *LeadResourceTypePublisherConfig `yaml:"leadResourceType,omitempty" json:"leadResourceType,omitempty"`
}

func (*ConfigPublisher) Validate

func (c *ConfigPublisher) Validate() error

type ConfigSubscriber added in v2.22.0

type ConfigSubscriber struct {
	Config           `yaml:",inline" json:",inline"`
	LeadResourceType *LeadResourceTypeSubscriberConfig `yaml:"leadResourceType,omitempty" json:"leadResourceType,omitempty"`
}

type LeadResourceTypeFilter added in v2.22.0

type LeadResourceTypeFilter string
const (
	LeadResourceTypeFilter_None  LeadResourceTypeFilter = ""
	LeadResourceTypeFilter_First LeadResourceTypeFilter = "first"
	LeadResourceTypeFilter_Last  LeadResourceTypeFilter = "last"
)

type LeadResourceTypePublisherConfig added in v2.22.0

type LeadResourceTypePublisherConfig struct {
	Enabled     bool                   `yaml:"enabled" json:"enabled"`
	RegexFilter []string               `yaml:"regexFilter" json:"regexFilter"`
	Filter      LeadResourceTypeFilter `yaml:"filter" json:"filter"`
	UseUUID     bool                   `yaml:"useUUID" json:"useUUID"`
	// contains filtered or unexported fields
}

func (*LeadResourceTypePublisherConfig) GetCompiledRegexFilter added in v2.22.0

func (c *LeadResourceTypePublisherConfig) GetCompiledRegexFilter() []*regexp.Regexp

func (*LeadResourceTypePublisherConfig) IsEnabled added in v2.22.0

func (c *LeadResourceTypePublisherConfig) IsEnabled() bool

func (*LeadResourceTypePublisherConfig) Validate added in v2.22.0

func (c *LeadResourceTypePublisherConfig) Validate() error

type LeadResourceTypeSubscriberConfig added in v2.22.0

type LeadResourceTypeSubscriberConfig struct {
	Enabled bool `yaml:"enabled" json:"enabled"`
}

func (*LeadResourceTypeSubscriberConfig) IsEnabled added in v2.22.0

func (c *LeadResourceTypeSubscriberConfig) IsEnabled() bool

type PendingLimitsConfig

type PendingLimitsConfig struct {
	MsgLimit   int `yaml:"msgLimit" json:"msgLimit"`
	BytesLimit int `yaml:"bytesLimit" json:"bytesLimit"`
}

func (*PendingLimitsConfig) Validate

func (c *PendingLimitsConfig) Validate() error

Jump to

Keyboard shortcuts

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