Documentation ¶
Index ¶
- Constants
- Variables
- func CfgWithContext(ctx context.Context, cfg *Configs) context.Context
- func NewClient(ctx context.Context, opts []grpc.DialOption) (*grpc.ClientConn, error)
- func NewServer(ctx context.Context, opts []grpc.ServerOption) (*grpc.Server, error)
- func WithClientRetry(ctx context.Context, opts []grpc.DialOption) ([]grpc.DialOption, error)
- func WithClientTLS(ctx context.Context, opts []grpc.DialOption) ([]grpc.DialOption, error)
- func WithServerLogger(ctx context.Context, opts []grpc.ServerOption) ([]grpc.ServerOption, error)
- func WithServerTLS(ctx context.Context, opts []grpc.ServerOption) ([]grpc.ServerOption, error)
- type Configs
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 NewClient ¶
func NewClient(ctx context.Context, opts []grpc.DialOption) (*grpc.ClientConn, 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"` }
Click to show internal directories.
Click to hide internal directories.