client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDialOption

func RegisterDialOption(name string, f func(configuration *conf.Configuration) grpc.DialOption)

func RegisterStreamClientInterceptor

func RegisterStreamClientInterceptor(name string, f func(configuration *conf.Configuration) grpc.StreamClientInterceptor)

func RegisterUnaryClientInterceptor

func RegisterUnaryClientInterceptor(name string, f func(configuration *conf.Configuration) grpc.UnaryClientInterceptor)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Client

func (*Client) Apply

func (c *Client) Apply(cfg *conf.Configuration)

func (*Client) Dial

func (c *Client) Dial(target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

Dial creates a gRPC client connection with the given target,and covert to DialContext if client.timeout > 0

func (*Client) DialContext added in v0.0.3

func (c *Client) DialContext(ctx context.Context, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

DialContext creates a gRPC client connection with the given target.

The target will be parsed as a URL.your resolver must parse the target.

type Option

type Option func(client *Client)

func Configuration

func Configuration(configuration *conf.Configuration) Option

type ServerConfig

type ServerConfig struct {
	Addr           string `json:"addr" yaml:"addr"`
	SSLCertificate string `json:"sslCertificate" yaml:"sslCertificate"`
	Namespace      string `json:"namespace" yaml:"namespace"`
	Version        string `json:"version" yaml:"version"`
}

Jump to

Keyboard shortcuts

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