driver

package
v0.0.0-...-84faedb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GRPC  = "GRPC"
	REDIS = "REDIS"
	ETCD  = "ETCD"
	AMQP  = "AMQP"
)

Functions

func NewGrpcServiceAndListen

func NewGrpcServiceAndListen(c *conf.Config)

Types

type GrpcClient

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

func NewGrpcClient

func NewGrpcClient(addr string, ctx context.Context) *GrpcClient

func (*GrpcClient) GatewaySubscribe

func (c *GrpcClient) GatewaySubscribe(ip string, onMegReceived OnMessageReceived, onErrReceiving ...OnErrReceiving) error

func (*GrpcClient) SendCertificateToGateway

func (c *GrpcClient) SendCertificateToGateway(localId string) error

func (*GrpcClient) SyncCertificateToProvider

func (c *GrpcClient) SyncCertificateToProvider(certificateList *pb.CertificateList) error

type IProvider

type IProvider interface {
	//GatewaySubscribe Gateway订阅
	GatewaySubscribe(localIp string, onMegReceived OnMessageReceived, onErrReceiving ...OnErrReceiving) error

	//SendCertificateToGateway 发送证书同步给某个 Gateway
	SendCertificateToGateway(localIP string) error

	// SyncCertificateToProvider Issuer发送证书给Provider
	SyncCertificateToProvider(certificateList *pb.CertificateList) error
}

type OnErrReceiving

type OnErrReceiving = func(err error)

type OnMessageReceived

type OnMessageReceived = func(certs []*pb.Cert)

type RedisClient

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

RedisClient redis client

func NewRedisClient

func NewRedisClient(addr []string, user, pass, masterName string, db int) *RedisClient

NewRedisClient new a redis client

func (*RedisClient) GatewaySubscribe

func (r *RedisClient) GatewaySubscribe(localIP string, received OnMessageReceived, receiving ...OnErrReceiving) error

func (*RedisClient) SendCertificateToGateway

func (r *RedisClient) SendCertificateToGateway(localIP string) error

func (*RedisClient) SyncCertificateToProvider

func (r *RedisClient) SyncCertificateToProvider(certificateList *pb.CertificateList) error

Jump to

Keyboard shortcuts

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