xds

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 21 Imported by: 0

README

xds

SDK to bootstrap xDS server

TODO

  1. implement secret discovery service (SDS) with https://github.com/smallstep/step-sds

Documentation

Index

Constants

View Source
const (
	STATIC     = "static"
	FILE       = "file"
	DNS        = "dns"
	KUBERNETES = "kubernetes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// MaxConcurrentStreams max concurrent streams for gRPC server
	MaxConcurrentStreams uint32        `yaml:"max_concurrent_streams,omitempty" validate:"omitempty,number" default:"1000000"`
	SourceType           string        `yaml:"source_type,omitempty" validate:"oneof=dns kubernetes file static" default:"static"`
	NodeID               string        `yaml:"node_id,omitempty" validate:"required,uuid"`
	RefreshInterval      time.Duration `yaml:"refresh_interval,omitempty" validate:"omitempty,min=0s,max=1h" default:"0s"`
	// Namespace to monitor when SourceType = kubernetes
	Namespace string `yaml:"namespace,omitempty" validate:"omitempty,alphanum" default:"xds"`
}

Configuration is for xds config

type Option

type Option func(*Options)

func SourceType

func SourceType(t string) Option

SourceType Type of the endpoints source

func WithFS

func WithFS(fs fs.FS) Option

WithFS enables use custom FileSystem to load config files. e.g., embed.FS default: os.DirFS(".")

func WithNamespace

func WithNamespace(n string) Option

WithNamespace : kubernetes namespace to monitor for endpoints

func WithRefreshInterval

func WithRefreshInterval(interval time.Duration) Option

WithRefreshInterval specifies the interval to poll Source for endpoints updates. default = 0, means: never refresh

type Options

type Options struct {
	SourceType      string
	RefreshInterval time.Duration
	Namespace       string
	// FileSystem to load config files from. default: os.DirFS(".")
	FileSys fs.FS
}

type Refresher

type Refresher interface {
	GetSnapshotCache() cachev3.SnapshotCache
	Start() error
}

func NewRefresher

func NewRefresher(ctx context.Context, opts ...Option) (r Refresher)

NewRefresher is generic constructor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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