client

package
v0.0.0-...-c7f4476 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 28 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCancelWatch = errors.New("cancel watch")
View Source
var LOG = log.NewHelper(log.With(log.GetLogger(), "source", "servicewatch"))

Functions

func AddWatch

func AddWatch(ctx context.Context, registry registry.Discovery, endpoint string, applier Applier) bool

func IsSecure

func IsSecure(u *url.URL) bool

IsSecure parses isSecure for Endpoint URL.

Types

type Applier

type Applier interface {
	Callback([]*registry.ServiceInstance) error
	Canceled() bool
}

type BuildContext

type BuildContext struct {
	TLSConfigs     map[string]*tls.Config
	TLSClientStore *HTTPSClientStore
}

func EmptyBuildContext

func EmptyBuildContext() *BuildContext

func NewBuildContext

func NewBuildContext(cfg *config.Gateway) *BuildContext

type Client

type Client interface {
	http.RoundTripper
	io.Closer
}

type Factory

type Factory func(*BuildContext, *config.Endpoint) (Client, error)

Factory is returns service client.

func NewFactory

func NewFactory(r registry.Discovery, opts ...Option) Factory

NewFactory new a client factory.

type HTTPSClientStore

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

func NewHTTPSClientStore

func NewHTTPSClientStore(clientConfigs map[string]*tls.Config) *HTTPSClientStore

func (*HTTPSClientStore) GetClient

func (s *HTTPSClientStore) GetClient(name string) *http.Client

type NewNodeOption

type NewNodeOption func(*NodeOptions)

func WithTLS

func WithTLS(in bool) NewNodeOption

func WithTLSConfigName

func WithTLSConfigName(in string) NewNodeOption

type NodeOptions

type NodeOptions struct {
	TLS           bool
	TLSConfigName string
}

type Option

type Option func(*options)

func WithPickerBuilder

func WithPickerBuilder(in selector.Builder) Option

type Target

type Target struct {
	Scheme    string
	Authority string
	Endpoint  string
}

Target is resolver target

Jump to

Keyboard shortcuts

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