grpcsrv

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGIdNotExist = errors.New("gid is not exist")
)

Functions

This section is empty.

Types

type Gateway

type Gateway struct {
	IsOpen     bool   `yaml:"isOpen"`
	CertFile   string `yaml:"certFile"`
	ServerName string `yaml:"serverName"`
}

type Grpc

type Grpc struct {
	ListenOn string  `yaml:"listenOn"`
	KeyFile  string  `yaml:"keyFile"`
	CertFile string  `yaml:"certFile"`
	Gateway  Gateway `yaml:"gateway"`
}

func (*Grpc) OpenGateway

func (grpc *Grpc) OpenGateway() bool

func (*Grpc) Tls

func (grpc *Grpc) Tls() bool

type GrpcSrv

type GrpcSrv struct {
	proto.UnimplementedEasyCarServer
	// contains filtered or unexported fields
}

func New

func New(settings Grpc, coordinator *coordinator.Coordinator) (*GrpcSrv, error)

func (*GrpcSrv) Begin

func (s *GrpcSrv) Begin(ctx context.Context, empty *emptypb.Empty) (*proto.BeginResp, error)

func (*GrpcSrv) Commit

func (s *GrpcSrv) Commit(ctx context.Context, req *proto.CommitReq) (*emptypb.Empty, error)

func (*GrpcSrv) Endpoint

func (s *GrpcSrv) Endpoint() *url.URL

func (*GrpcSrv) GetState

func (s *GrpcSrv) GetState(ctx context.Context, req *proto.GetStateReq) (*proto.GetStateResp, error)

func (*GrpcSrv) Handler

func (s *GrpcSrv) Handler(certFile, name string) httpsrv.Handler

func (*GrpcSrv) Register

func (s *GrpcSrv) Register(ctx context.Context, req *proto.RegisterReq) (*emptypb.Empty, error)

func (*GrpcSrv) Rollback

func (s *GrpcSrv) Rollback(ctx context.Context, req *proto.RollBckReq) (*emptypb.Empty, error)

func (*GrpcSrv) Run

func (s *GrpcSrv) Run(ctx context.Context) error

func (*GrpcSrv) Start

func (s *GrpcSrv) Start(ctx context.Context, req *proto.StartReq) (*emptypb.Empty, error)

func (*GrpcSrv) Stop

func (s *GrpcSrv) Stop(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

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