clients

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConnParams = grpc.ConnectParams{
	Backoff: backoff.Config{
		BaseDelay:  time.Second * 1.0,
		Multiplier: 1.0,
		Jitter:     0,
		MaxDelay:   10 * time.Second,
	},
	MinConnectTimeout: time.Second * 3,
}
View Source
var Kacp = keepalive.ClientParameters{
	Time:                10 * time.Second,
	Timeout:             3 * time.Second,
	PermitWithoutStream: true,
}

grpc client params

Functions

This section is empty.

Types

type AppClient

type AppClient struct {
	Builder *AppResolverBuilder
	Conn    *grpc.ClientConn
	proto.DriverToAppServiceClient
}

func NewAppRpcClient

func NewAppRpcClient(builder *AppResolverBuilder) (*AppClient, error)

func (*AppClient) Close

func (c *AppClient) Close() error

type AppClientCnnMap

type AppClientCnnMap map[int]*AppClient //rpc连接数和AppClient对应关系

type AppResolverBuilder

type AppResolverBuilder struct {
	AppSerivceName string
	Addr           string
	AddrChan       chan string
}

func (*AppResolverBuilder) Build

func (*AppResolverBuilder) Scheme

func (*AppResolverBuilder) Scheme() string

type AppService

type AppService struct {
	Name      string
	RpcClient AppClient
}

type COSClient

type COSClient struct {
	*cos.Client
	// contains filtered or unexported fields
}

func (*COSClient) UploadFile

func (c *COSClient) UploadFile(ctx context.Context, filename string, content []byte) (string, string, error)

返回:{"bucket":"ty-cn-storage30","objectKey":"/88012e-34125598-194c9d2a7048680e/v","secretKey":"c86440d1912a413d8d90d13097391159","expireTime":1551083405}

type DPReportClient

type DPReportClient struct {
	Conn *grpc.ClientConn
	proto.CommonClient
	proto.RpcEventClient
}

func NewDPReportClient

func NewDPReportClient(cfg config.ClientInfo) (*DPReportClient, error)

func (*DPReportClient) Close

func (rdc *DPReportClient) Close() error

type NewCliFunc

type NewCliFunc func() *DPReportClient

type OSSClientI

type OSSClientI interface {
	UploadFile(ctx context.Context, filename string, content []byte) (string, string, error)
}

func NewOSSClient

func NewOSSClient(cfg *common.ResultNode, logger commons.TedgeLogger) (OSSClientI, error)

type TyModelReportClient

type TyModelReportClient struct {
	Conn *grpc.ClientConn
	proto.CommonClient
	proto.ThingModelUpServiceClient
}

func NewTyModelReportClient

func NewTyModelReportClient(cfg config.ClientInfo) (*TyModelReportClient, error)

func (*TyModelReportClient) Close

func (tmrc *TyModelReportClient) Close() error

Jump to

Keyboard shortcuts

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