ggrpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MulanPSL-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name   string
	Config ClientConfig
	Client *grpc.ClientConn
}

func (*Client) NewClient

func (c *Client) NewClient(fn ClientFn) error

type ClientConfig

type ClientConfig struct {
	// Address specifies the client listening address like "port" or ":port",
	// multiple addresses joined using ','.
	Address string `json:"address"`
	// AutoClose specifies  the client to close the connection internally
	AutoClose bool `json:"auto_close"`
	// Because Timeout does not let Handlers make per-request
	// decisions on each request body's acceptable deadline or
	// Timeout. It is valid to use them both.
	Timeout time.Duration `json:"timeout"`
	//Tracing specifies whether link tracking
	Tracing bool `json:"tracing"`
}

ClientConfig is the GRPC Client configuration manager.

type ClientFn

type ClientFn func(conn *grpc.ClientConn, ctx context.Context) (err error)

type Server

type Server struct {
	Name   string       // Unique name for instance management.
	Config ServerConfig // Configuration.
	Server *grpc.Server
}

Server wraps the http.Server and provides more feature.

func (*Server) NewServer

func (s *Server) NewServer(fn ServerFnc) error

type ServerConfig

type ServerConfig struct {
	// Address specifies the server listening address like "port" or ":port",
	// multiple addresses joined using ','.
	Address string `json:"address"`
	//Tracing specifies whether link tracking
	Tracing bool `json:"tracing"`
}

ServerConfig is the GRPC Server configuration manager.

type ServerFnc

type ServerFnc func(server *grpc.Server)

Jump to

Keyboard shortcuts

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