grpc

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InjectedConn = "injected-connection"
)

Variables

View Source
var Startime = time.Now()

Functions

func GracefulTerminateDetect

func GracefulTerminateDetect()

GracefulTerminateDetect catches SIGTERM and SIGINT This function only detects the signal. It does not do anything with the detect. Use GracefulTerminateExec func to cleanup else write your own after calling GracefulTerminateDetect

func GracefulTerminateExec

func GracefulTerminateExec(grpcServer *grpc.Server)

GracefulTerminateExec performs a default list of tasks to clean up Override this function in your package to do more.

Types

type ClientBuilder

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

func (*ClientBuilder) Timeout

func (b *ClientBuilder) Timeout(to time.Duration)

type EscrowClientBuilder

type EscrowClientBuilder struct {
	ClientBuilder
}

func EscrowClient

func EscrowClient(addr string) *EscrowClientBuilder

func (*EscrowClientBuilder) WithContext

func (g *EscrowClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client escrowpb.EscrowServiceClient) error) error

type ExchangeClientBuilder

type ExchangeClientBuilder struct {
	ClientBuilder
}

func ExchangeClient

func ExchangeClient(addr string) *ExchangeClientBuilder

func (*ExchangeClientBuilder) WithContext

func (g *ExchangeClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client exchangepb.ExchangeClient) error) error

type GrpcServer

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

func (*GrpcServer) AcceptConnection

func (s *GrpcServer) AcceptConnection() *GrpcServer

func (*GrpcServer) CreateHealthServer

func (s *GrpcServer) CreateHealthServer() *GrpcServer

func (*GrpcServer) CreateServer

func (s *GrpcServer) CreateServer(serverName string, options ...grpc.ServerOption) *GrpcServer

func (*GrpcServer) GrpcServer

func (s *GrpcServer) GrpcServer(port string, dbURLs map[string]string, rdURL string,
	server interface{}, options ...grpc.ServerOption) (
	map[string]*postgres.TGPGDB, *redis.TGRDDB)

func (*GrpcServer) RegisterHealthServer

func (s *GrpcServer) RegisterHealthServer() *GrpcServer

func (*GrpcServer) RegisterServer

func (s *GrpcServer) RegisterServer(server interface{}) *GrpcServer

func (*GrpcServer) WithGracefulTermDetectAndExec

func (s *GrpcServer) WithGracefulTermDetectAndExec() *GrpcServer

func (*GrpcServer) WithReflection

func (s *GrpcServer) WithReflection() *GrpcServer

type GuardClientBuilder

type GuardClientBuilder struct {
	ClientBuilder
}

func GuardClient

func GuardClient(addr string) *GuardClientBuilder

func (*GuardClientBuilder) WithContext

func (g *GuardClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client guardpb.GuardServiceClient) error) error

type HealthCheckClientBuilder

type HealthCheckClientBuilder struct {
	ClientBuilder
}

func HealthCheckClient

func HealthCheckClient(addr string) *HealthCheckClientBuilder

func (*HealthCheckClientBuilder) WithContext

type HubParserClientBuilder

type HubParserClientBuilder struct {
	ClientBuilder
}

func HubParserClient

func HubParserClient(addr string) *HubParserClientBuilder

hub-parser

func (*HubParserClientBuilder) WithContext

func (g *HubParserClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client hubpb.HubParseServiceClient) error) error

type HubQueryClientBuilder

type HubQueryClientBuilder struct {
	ClientBuilder
}

func HubQueryClient

func HubQueryClient(addr string) *HubQueryClientBuilder

hub-query

func (*HubQueryClientBuilder) WithContext

func (g *HubQueryClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client hubpb.HubQueryServiceClient) error) error

type LedgerClientBuilder

type LedgerClientBuilder struct {
	ClientBuilder
}

func LedgerClient

func LedgerClient(addr string) *LedgerClientBuilder

func (*LedgerClientBuilder) WithContext

func (g *LedgerClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client ledgerpb.ChannelsClient) error) error

type OnlineClientBuilder

type OnlineClientBuilder struct {
	ClientBuilder
}

func OnlineClient

func OnlineClient(addr string) *OnlineClientBuilder

func (*OnlineClientBuilder) WithContext

func (g *OnlineClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client online.OnlineServiceClient) error) error

type RuntimeClientBuilder

type RuntimeClientBuilder struct {
	ClientBuilder
}

func RuntimeClient

func RuntimeClient(addr string) *RuntimeClientBuilder

func (*RuntimeClientBuilder) WithContext

func (g *RuntimeClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client sharedpb.RuntimeServiceClient) error) error

type RuntimeServer

type RuntimeServer struct {
	DB_URL map[string]string
	RD_URL string

	sharedpb.UnimplementedRuntimeServiceServer
	// contains filtered or unexported fields
}

func (*RuntimeServer) CheckRuntime

implementation of the shared helper function

type SolidityClientBuilder

type SolidityClientBuilder struct {
	ClientBuilder
}

func SolidityClient

func SolidityClient(addr string) *SolidityClientBuilder

func (*SolidityClientBuilder) WithContext

func (g *SolidityClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client tronpb.WalletSolidityClient) error) error

type StatusClientBuilder

type StatusClientBuilder struct {
	ClientBuilder
}

func StatusClient

func StatusClient(addr string) *StatusClientBuilder

func (*StatusClientBuilder) WithContext

func (g *StatusClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client statuspb.StatusServiceClient) error) error

type WalletClientBuilder

type WalletClientBuilder struct {
	ClientBuilder
}

func WalletClient

func WalletClient(addr string) *WalletClientBuilder

func (*WalletClientBuilder) WithContext

func (g *WalletClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context,
	client tronpb.WalletClient) error) error

Jump to

Keyboard shortcuts

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