config

package
v3.79.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultInterval = time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	config.Common
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Config

func (*Config) Clock added in v3.67.0

func (c *Config) Clock() clockwork.Clock

func (*Config) Database

func (c *Config) Database() string

func (*Config) Endpoint

func (c *Config) Endpoint() string

func (*Config) Interval

func (c *Config) Interval() time.Duration

func (*Config) Meta

func (c *Config) Meta() *meta.Meta

func (*Config) MutateAddress added in v3.67.0

func (c *Config) MutateAddress(fqdn string) string

func (*Config) Secure

func (c *Config) Secure() bool

func (*Config) Trace

func (c *Config) Trace() *trace.Discovery

type Option

type Option func(c *Config)

func With

func With(config config.Common) Option

With applies common configuration params

func WithAddressMutator added in v3.67.0

func WithAddressMutator(addressMutator func(address string) string) Option

func WithClock added in v3.67.0

func WithClock(clock clockwork.Clock) Option

func WithDatabase

func WithDatabase(database string) Option

WithDatabase set a required database name.

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint set a required starting endpoint for connect

func WithInterval

func WithInterval(interval time.Duration) Option

WithInterval set the frequency of background tasks of ydb endpoints discovery.

If Interval is zero then the DefaultInterval is used.

If Interval is negative, then no background discovery prepared.

func WithMeta

func WithMeta(meta *meta.Meta) Option

WithMeta is not for user.

This option add meta information about database connection

func WithSecure

func WithSecure(ssl bool) Option

WithSecure set flag for secure connection

func WithTrace

func WithTrace(trace trace.Discovery, opts ...trace.DiscoveryComposeOption) Option

WithTrace configures discovery client calls tracing

Jump to

Keyboard shortcuts

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