server

package
v0.0.0-...-5642128 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ResolverName string = "dcache"

Variables

This section is empty.

Functions

func NewServer

func NewServer(cache Cache, grpcOpts ...grpc.ServerOption) (
	*grpc.Server, error,
)

NewServer returns a grpc.Server with the given options applied.

func NewServerWithGetter

func NewServerWithGetter(cache Cache, getter ServerFinder, grpcOpts ...grpc.ServerOption) (
	*grpc.Server, error,
)

NewServer returns a grpc.Server with the given options applied.

Types

type Cache

type Cache interface {
	Set(key string, value []byte) error
	Get(key string) ([]byte, error)
}

Cache interface that represents the most basic operations of the cache.

type Picker

type Picker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Picker) Build

func (p *Picker) Build(buildInfo base.PickerBuildInfo) balancer.Picker

func (*Picker) Pick

func (p *Picker) Pick(info balancer.PickInfo) (balancer.PickResult, error)

type Resolver

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

func (*Resolver) Build

func (*Resolver) Close

func (r *Resolver) Close()

Close tears down clientConn and all underlying connections

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(resolver.ResolveNowOptions)

func (*Resolver) Scheme

func (r *Resolver) Scheme() string

type ServerFinder

type ServerFinder interface {
	GetServers() ([]*pb.Server, error)
}

ServerFinder is to combat compatibility issues with adding GetServers() to the cache struct. Since that would make us change the tests fully since we cannot use bigcache easily.

Jump to

Keyboard shortcuts

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