Documentation ¶
Index ¶
- Constants
- Variables
- func GracefulTerminateDetect()
- func GracefulTerminateExec(grpcServer *grpc.Server)
- type ClientBuilder
- type EscrowClientBuilder
- type ExchangeClientBuilder
- type GrpcServer
- func (s *GrpcServer) AcceptConnection() *GrpcServer
- func (s *GrpcServer) CreateHealthServer() *GrpcServer
- func (s *GrpcServer) CreateServer(serverName string, options ...grpc.ServerOption) *GrpcServer
- func (s *GrpcServer) GrpcServer(port string, dbURLs map[string]string, rdURL string, server interface{}, ...) (map[string]*postgres.TGPGDB, *redis.TGRDDB)
- func (s *GrpcServer) RegisterHealthServer() *GrpcServer
- func (s *GrpcServer) RegisterServer(server interface{}) *GrpcServer
- func (s *GrpcServer) WithGracefulTermDetectAndExec() *GrpcServer
- func (s *GrpcServer) WithReflection() *GrpcServer
- type GuardClientBuilder
- type HealthCheckClientBuilder
- type HubParserClientBuilder
- type HubQueryClientBuilder
- type LedgerClientBuilder
- type OnlineClientBuilder
- type RuntimeClientBuilder
- type RuntimeServer
- type SolidityClientBuilder
- type StatusClientBuilder
- type WalletClientBuilder
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 ¶
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 (*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 ¶
func (g *HealthCheckClientBuilder) WithContext(ctx context.Context, f func(ctx context.Context, client grpc_health_v1.HealthClient) error) error
type HubParserClientBuilder ¶
type HubParserClientBuilder struct {
ClientBuilder
}
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 (*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 ¶
func (s *RuntimeServer) CheckRuntime(ctx context.Context, req *sharedpb.SignedRuntimeInfoRequest) (*sharedpb.RuntimeInfoReport, error)
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
Click to show internal directories.
Click to hide internal directories.