xrpc

package
v0.0.0-...-a136232 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CTXKEY_CFG ctxkey = "ackstream.xrpc.configs"

Variables

View Source
var ErrCACertNotLoad = errors.New("could not load CA certificate")
View Source
var ErrCfgNotFound = errors.New("no configs was set")

Functions

func CfgWithContext

func CfgWithContext(ctx context.Context, cfg *Configs) context.Context

func NewClient

func NewClient(ctx context.Context, opts []grpc.DialOption) (*grpc.ClientConn, error)

func NewServer

func NewServer(ctx context.Context, opts []grpc.ServerOption) (*grpc.Server, error)

func WithClientRetry

func WithClientRetry(ctx context.Context, opts []grpc.DialOption) ([]grpc.DialOption, error)

func WithClientTLS

func WithClientTLS(ctx context.Context, opts []grpc.DialOption) ([]grpc.DialOption, error)

func WithServerLogger

func WithServerLogger(ctx context.Context, opts []grpc.ServerOption) ([]grpc.ServerOption, error)

func WithServerTLS

func WithServerTLS(ctx context.Context, opts []grpc.ServerOption) ([]grpc.ServerOption, error)

Types

type Configs

type Configs struct {
	ServerCertsDir      string `json:"server_certs_dir" mapstructure:"ACKSTREAM_XRPC_SERVER_CERTS_DIR"`
	ServerListenAddress string `json:"server_listen_address" mapstructure:"ACKSTREAM_XRPC_SERVER_LISTEN_ADDRESS"`
	ClientCertFile      string `json:"client_cert_dir" mapstructure:"ACKSTREAM_XRPC_CLIENT_CERT_FILE"`
	ClientRemoteAddress string `json:"client_remote_address" mapstructure:"ACKSTREAM_XRPC_CLIENT_REMOTE_ADDRESS"`
}

func CfgFromContext

func CfgFromContext(ctx context.Context) (*Configs, error)

Jump to

Keyboard shortcuts

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