queryservice

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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 ConfigService interface {
	UnmarshalKey(key string, rawVal interface{}) error
}

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

func NewProvider(configProvider config.Provider) Provider

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 (*RemoteQueryService) GetStates

type RemoteQueryServiceProvider

type RemoteQueryServiceProvider struct {
	ConfigProvider config.Provider
}

func (*RemoteQueryServiceProvider) Get

func (r *RemoteQueryServiceProvider) Get(network, channel string) (QueryService, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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