Documentation
¶
Index ¶
- Constants
- Variables
- func GrpcClient(c *Config) (*grpc.ClientConn, error)
- func WithConnectionTime(timeout time.Duration) grpc.DialOption
- func WithTLS(endpoint Endpoint) grpc.DialOption
- type Config
- type ConfigService
- type Endpoint
- type Provider
- type QueryService
- type RemoteQueryService
- type RemoteQueryServiceProvider
Constants ¶
View Source
const DefaultQueryTimeout = 30 * time.Second
Variables ¶
View Source
var ErrInvalidAddress = fmt.Errorf("empty address")
View Source
var (
ErrInvalidQueryInput = fmt.Errorf("invalid query input")
)
Functions ¶
func GrpcClient ¶
func GrpcClient(c *Config) (*grpc.ClientConn, error)
func WithConnectionTime ¶
func WithConnectionTime(timeout time.Duration) grpc.DialOption
func WithTLS ¶
func WithTLS(endpoint Endpoint) grpc.DialOption
Types ¶
type Config ¶
type Config struct { Endpoints []Endpoint `yaml:"endpoints,omitempty"` QueryTimeout time.Duration `yaml:"queryTimeout,omitempty"` }
func NewConfig ¶
func NewConfig(configService ConfigService) (*Config, error)
type ConfigService ¶
type Endpoint ¶
type Endpoint struct { Address string `yaml:"address,omitempty"` ConnectionTimeout time.Duration `yaml:"connectionTimeout,omitempty"` TLSEnabled bool `yaml:"tlsEnabled,omitempty"` TLSRootCertFile string `yaml:"tlsRootCertFile,omitempty"` TLSServerNameOverride string `yaml:"tlsServerNameOverride,omitempty"` }
type Provider ¶
type Provider interface {
Get(network, channel string) (QueryService, error)
}
func NewProvider ¶
type QueryService ¶
type QueryService interface { GetState(ns driver.Namespace, key driver.PKey) (*driver.VaultValue, error) GetStates(map[driver.Namespace][]driver.PKey) (map[driver.Namespace]map[driver.PKey]driver.VaultValue, error) }
func GetQueryService ¶
func GetQueryService(sp services.Provider, network, channel string) (QueryService, error)
type RemoteQueryService ¶
type RemoteQueryService struct {
// contains filtered or unexported fields
}
func NewRemoteQueryService ¶
func NewRemoteQueryService(config *Config, client protoqueryservice.QueryServiceClient) *RemoteQueryService
func NewRemoteQueryServiceFromConfig ¶
func NewRemoteQueryServiceFromConfig(configService fdriver.ConfigService) (*RemoteQueryService, error)
func (*RemoteQueryService) GetState ¶
func (s *RemoteQueryService) GetState(ns driver.Namespace, key driver.PKey) (*driver.VaultValue, error)
type RemoteQueryServiceProvider ¶
func (*RemoteQueryServiceProvider) Get ¶
func (r *RemoteQueryServiceProvider) Get(network, channel string) (QueryService, error)
Click to show internal directories.
Click to hide internal directories.