function

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(cfg Config, ctx context2.Context, resolver resolve.Resolver) (*API, error)

func (*API) Close

func (a *API) Close()

Close closes api

type ClientConfig

type ClientConfig struct {
	Grpc GrpcConfig `yaml:"grpc" json:"grpc"`
}

type Config

type Config struct {
	Server http.ServerConfig `yaml:"server" json:"server"`
	Client ClientConfig      `yaml:"client" json:"client"`
}

Config

type Endpoint

type Endpoint struct {
	Methods []string
	Route   string
	Handler func(c *routing.Context) error
}

type ErrorResponse

type ErrorResponse struct {
	ErrCode string `json:"errCode"`
	Message string `json:"message"`
}

ErrorResponse ErrorResponse

func NewErrorResponse

func NewErrorResponse(errCode, message string) ErrorResponse

NewErrorResponse NewErrorResponse

type GrpcConfig

type GrpcConfig struct {
	Port    int           `yaml:"port" json:"port" default:"80"`
	Timeout time.Duration `yaml:"timeout" json:"timeout" default:"5m"`
	Retries int           `yaml:"retries" json:"retries" default:"3"`
}

type Manager

type Manager interface {
	GetGRPCConnection(string, bool) (*grpc.ClientConn, error)
	io.Closer
}

Manager Manager

func NewManager

func NewManager(cert utils.Certificate) (Manager, error)

NewGRPCManager

Jump to

Keyboard shortcuts

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