services

package
v0.0.0-...-be882d2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package services is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package services is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package services is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "UNKNOWN",
		1: "CREATED",
		2: "SUBMITTED",
		3: "SETTLED",
		4: "FAILED",
	}
	Status_value = map[string]int32{
		"UNKNOWN":   0,
		"CREATED":   1,
		"SUBMITTED": 2,
		"SETTLED":   3,
		"FAILED":    4,
	}
)

Enum value maps for Status.

View Source
var File_services_explorer_service_proto protoreflect.FileDescriptor
View Source
var File_services_relay_service_proto protoreflect.FileDescriptor
View Source
var File_services_witness_service_proto protoreflect.FileDescriptor

Functions

func RegisterExplorerServiceHandler

func RegisterExplorerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterExplorerServiceHandler registers the http handlers for service ExplorerService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterExplorerServiceHandlerClient

func RegisterExplorerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExplorerServiceClient) error

RegisterExplorerServiceHandlerClient registers the http handlers for service ExplorerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ExplorerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ExplorerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ExplorerServiceClient" to call the correct interceptors.

func RegisterExplorerServiceHandlerFromEndpoint

func RegisterExplorerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterExplorerServiceHandlerFromEndpoint is same as RegisterExplorerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterExplorerServiceHandlerServer

func RegisterExplorerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExplorerServiceServer) error

RegisterExplorerServiceHandlerServer registers the http handlers for service ExplorerService to "mux". UnaryRPC :call ExplorerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterExplorerServiceHandlerFromEndpoint instead.

func RegisterExplorerServiceServer

func RegisterExplorerServiceServer(s *grpc.Server, srv ExplorerServiceServer)

func RegisterRelayServiceHandler

func RegisterRelayServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterRelayServiceHandler registers the http handlers for service RelayService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterRelayServiceHandlerClient

func RegisterRelayServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RelayServiceClient) error

RegisterRelayServiceHandlerClient registers the http handlers for service RelayService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RelayServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RelayServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RelayServiceClient" to call the correct interceptors.

func RegisterRelayServiceHandlerFromEndpoint

func RegisterRelayServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterRelayServiceHandlerFromEndpoint is same as RegisterRelayServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterRelayServiceHandlerServer

func RegisterRelayServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RelayServiceServer) error

RegisterRelayServiceHandlerServer registers the http handlers for service RelayService to "mux". UnaryRPC :call RelayServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRelayServiceHandlerFromEndpoint instead.

func RegisterRelayServiceServer

func RegisterRelayServiceServer(s *grpc.Server, srv RelayServiceServer)

func RegisterWitnessServiceHandler

func RegisterWitnessServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterWitnessServiceHandler registers the http handlers for service WitnessService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterWitnessServiceHandlerClient

func RegisterWitnessServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WitnessServiceClient) error

RegisterWitnessServiceHandlerClient registers the http handlers for service WitnessService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WitnessServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WitnessServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WitnessServiceClient" to call the correct interceptors.

func RegisterWitnessServiceHandlerFromEndpoint

func RegisterWitnessServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterWitnessServiceHandlerFromEndpoint is same as RegisterWitnessServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterWitnessServiceHandlerServer

func RegisterWitnessServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WitnessServiceServer) error

RegisterWitnessServiceHandlerServer registers the http handlers for service WitnessService to "mux". UnaryRPC :call WitnessServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWitnessServiceHandlerFromEndpoint instead.

func RegisterWitnessServiceServer

func RegisterWitnessServiceServer(s *grpc.Server, srv WitnessServiceServer)

Types

type CheckRequest

type CheckRequest struct {
	Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckRequest) Descriptor deprecated

func (*CheckRequest) Descriptor() ([]byte, []int)

Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.

func (*CheckRequest) GetId

func (x *CheckRequest) GetId() []byte

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

func (x *CheckRequest) ProtoReflect() protoreflect.Message

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckResponse

type CheckResponse struct {
	Key       []byte   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Witnesses [][]byte `protobuf:"bytes,2,rep,name=witnesses,proto3" json:"witnesses,omitempty"`
	TxHash    []byte   `protobuf:"bytes,3,opt,name=txHash,proto3" json:"txHash,omitempty"`
	Status    Status   `protobuf:"varint,4,opt,name=status,proto3,enum=services.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckResponse) Descriptor deprecated

func (*CheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.

func (*CheckResponse) GetKey

func (x *CheckResponse) GetKey() []byte

func (*CheckResponse) GetStatus

func (x *CheckResponse) GetStatus() Status

func (*CheckResponse) GetTxHash

func (x *CheckResponse) GetTxHash() []byte

func (*CheckResponse) GetWitnesses

func (x *CheckResponse) GetWitnesses() [][]byte

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

func (x *CheckResponse) ProtoReflect() protoreflect.Message

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) String

func (x *CheckResponse) String() string

type ExplorerQueryRequest

type ExplorerQueryRequest struct {
	First     int32    `protobuf:"varint,1,opt,name=first,proto3" json:"first,omitempty"`
	Skip      int32    `protobuf:"varint,2,opt,name=skip,proto3" json:"skip,omitempty"`
	Token     []byte   `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	Sender    []byte   `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"`
	Recipient []byte   `protobuf:"bytes,5,opt,name=recipient,proto3" json:"recipient,omitempty"`
	Status    Status   `protobuf:"varint,6,opt,name=status,proto3,enum=services.Status" json:"status,omitempty"`
	Cashiers  [][]byte `protobuf:"bytes,7,rep,name=cashiers,proto3" json:"cashiers,omitempty"`
	// contains filtered or unexported fields
}

func (*ExplorerQueryRequest) Descriptor deprecated

func (*ExplorerQueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExplorerQueryRequest.ProtoReflect.Descriptor instead.

func (*ExplorerQueryRequest) GetCashiers

func (x *ExplorerQueryRequest) GetCashiers() [][]byte

func (*ExplorerQueryRequest) GetFirst

func (x *ExplorerQueryRequest) GetFirst() int32

func (*ExplorerQueryRequest) GetRecipient

func (x *ExplorerQueryRequest) GetRecipient() []byte

func (*ExplorerQueryRequest) GetSender

func (x *ExplorerQueryRequest) GetSender() []byte

func (*ExplorerQueryRequest) GetSkip

func (x *ExplorerQueryRequest) GetSkip() int32

func (*ExplorerQueryRequest) GetStatus

func (x *ExplorerQueryRequest) GetStatus() Status

func (*ExplorerQueryRequest) GetToken

func (x *ExplorerQueryRequest) GetToken() []byte

func (*ExplorerQueryRequest) ProtoMessage

func (*ExplorerQueryRequest) ProtoMessage()

func (*ExplorerQueryRequest) ProtoReflect

func (x *ExplorerQueryRequest) ProtoReflect() protoreflect.Message

func (*ExplorerQueryRequest) Reset

func (x *ExplorerQueryRequest) Reset()

func (*ExplorerQueryRequest) String

func (x *ExplorerQueryRequest) String() string

type ExplorerQueryResponse

type ExplorerQueryResponse struct {
	Transfers []*types.Transfer `protobuf:"bytes,1,rep,name=transfers,proto3" json:"transfers,omitempty"`
	Statuses  []*CheckResponse  `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"`
	Count     uint32            `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*ExplorerQueryResponse) Descriptor deprecated

func (*ExplorerQueryResponse) Descriptor() ([]byte, []int)

Deprecated: Use ExplorerQueryResponse.ProtoReflect.Descriptor instead.

func (*ExplorerQueryResponse) GetCount

func (x *ExplorerQueryResponse) GetCount() uint32

func (*ExplorerQueryResponse) GetStatuses

func (x *ExplorerQueryResponse) GetStatuses() []*CheckResponse

func (*ExplorerQueryResponse) GetTransfers

func (x *ExplorerQueryResponse) GetTransfers() []*types.Transfer

func (*ExplorerQueryResponse) ProtoMessage

func (*ExplorerQueryResponse) ProtoMessage()

func (*ExplorerQueryResponse) ProtoReflect

func (x *ExplorerQueryResponse) ProtoReflect() protoreflect.Message

func (*ExplorerQueryResponse) Reset

func (x *ExplorerQueryResponse) Reset()

func (*ExplorerQueryResponse) String

func (x *ExplorerQueryResponse) String() string

type ExplorerServiceClient

type ExplorerServiceClient interface {
	Query(ctx context.Context, in *ExplorerQueryRequest, opts ...grpc.CallOption) (*ExplorerQueryResponse, error)
}

ExplorerServiceClient is the client API for ExplorerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type ExplorerServiceServer

type ExplorerServiceServer interface {
	Query(context.Context, *ExplorerQueryRequest) (*ExplorerQueryResponse, error)
	// contains filtered or unexported methods
}

ExplorerServiceServer is the server API for ExplorerService service. All implementations must embed UnimplementedExplorerServiceServer for forward compatibility

type ListRequest

type ListRequest struct {
	First     int32  `protobuf:"varint,1,opt,name=first,proto3" json:"first,omitempty"`
	Skip      int32  `protobuf:"varint,2,opt,name=skip,proto3" json:"skip,omitempty"`
	Token     []byte `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	Sender    []byte `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"`
	Recipient []byte `protobuf:"bytes,5,opt,name=recipient,proto3" json:"recipient,omitempty"`
	Status    Status `protobuf:"varint,6,opt,name=status,proto3,enum=services.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetFirst

func (x *ListRequest) GetFirst() int32

func (*ListRequest) GetRecipient

func (x *ListRequest) GetRecipient() []byte

func (*ListRequest) GetSender

func (x *ListRequest) GetSender() []byte

func (*ListRequest) GetSkip

func (x *ListRequest) GetSkip() int32

func (*ListRequest) GetStatus

func (x *ListRequest) GetStatus() Status

func (*ListRequest) GetToken

func (x *ListRequest) GetToken() []byte

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Transfers []*types.Transfer `protobuf:"bytes,1,rep,name=transfers,proto3" json:"transfers,omitempty"`
	Statuses  []*CheckResponse  `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"`
	Count     uint32            `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetCount

func (x *ListResponse) GetCount() uint32

func (*ListResponse) GetStatuses

func (x *ListResponse) GetStatuses() []*CheckResponse

func (*ListResponse) GetTransfers

func (x *ListResponse) GetTransfers() []*types.Transfer

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type QueryRequest

type QueryRequest struct {
	Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

func (*QueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetId

func (x *QueryRequest) GetId() []byte

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) ProtoReflect

func (x *QueryRequest) ProtoReflect() protoreflect.Message

func (*QueryRequest) Reset

func (x *QueryRequest) Reset()

func (*QueryRequest) String

func (x *QueryRequest) String() string

type QueryResponse

type QueryResponse struct {
	Transfer *types.Transfer `protobuf:"bytes,1,opt,name=transfer,proto3" json:"transfer,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryResponse) Descriptor deprecated

func (*QueryResponse) Descriptor() ([]byte, []int)

Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.

func (*QueryResponse) GetTransfer

func (x *QueryResponse) GetTransfer() *types.Transfer

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) ProtoReflect

func (x *QueryResponse) ProtoReflect() protoreflect.Message

func (*QueryResponse) Reset

func (x *QueryResponse) Reset()

func (*QueryResponse) String

func (x *QueryResponse) String() string

type RelayServiceClient

type RelayServiceClient interface {
	Submit(ctx context.Context, in *types.Witness, opts ...grpc.CallOption) (*WitnessSubmissionResponse, error)
	Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
}

RelayServiceClient is the client API for RelayService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type RelayServiceServer

type RelayServiceServer interface {
	Submit(context.Context, *types.Witness) (*WitnessSubmissionResponse, error)
	Check(context.Context, *CheckRequest) (*CheckResponse, error)
	List(context.Context, *ListRequest) (*ListResponse, error)
	// contains filtered or unexported methods
}

RelayServiceServer is the server API for RelayService service. All implementations must embed UnimplementedRelayServiceServer for forward compatibility

type Status

type Status int32
const (
	Status_UNKNOWN   Status = 0
	Status_CREATED   Status = 1
	Status_SUBMITTED Status = 2
	Status_SETTLED   Status = 3
	Status_FAILED    Status = 4
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type UnimplementedExplorerServiceServer

type UnimplementedExplorerServiceServer struct {
}

UnimplementedExplorerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedExplorerServiceServer) Query

type UnimplementedRelayServiceServer

type UnimplementedRelayServiceServer struct {
}

UnimplementedRelayServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRelayServiceServer) Check

func (UnimplementedRelayServiceServer) List

func (UnimplementedRelayServiceServer) Submit

type UnimplementedWitnessServiceServer

type UnimplementedWitnessServiceServer struct {
}

UnimplementedWitnessServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedWitnessServiceServer) Query

type UnsafeExplorerServiceServer

type UnsafeExplorerServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeExplorerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExplorerServiceServer will result in compilation errors.

type UnsafeRelayServiceServer

type UnsafeRelayServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeRelayServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RelayServiceServer will result in compilation errors.

type UnsafeWitnessServiceServer

type UnsafeWitnessServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeWitnessServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WitnessServiceServer will result in compilation errors.

type WitnessServiceClient

type WitnessServiceClient interface {
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
}

WitnessServiceClient is the client API for WitnessService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type WitnessServiceServer

type WitnessServiceServer interface {
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
	// contains filtered or unexported methods
}

WitnessServiceServer is the server API for WitnessService service. All implementations must embed UnimplementedWitnessServiceServer for forward compatibility

type WitnessSubmissionResponse

type WitnessSubmissionResponse struct {
	Id      []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Success bool   `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*WitnessSubmissionResponse) Descriptor deprecated

func (*WitnessSubmissionResponse) Descriptor() ([]byte, []int)

Deprecated: Use WitnessSubmissionResponse.ProtoReflect.Descriptor instead.

func (*WitnessSubmissionResponse) GetId

func (x *WitnessSubmissionResponse) GetId() []byte

func (*WitnessSubmissionResponse) GetSuccess

func (x *WitnessSubmissionResponse) GetSuccess() bool

func (*WitnessSubmissionResponse) ProtoMessage

func (*WitnessSubmissionResponse) ProtoMessage()

func (*WitnessSubmissionResponse) ProtoReflect

func (*WitnessSubmissionResponse) Reset

func (x *WitnessSubmissionResponse) Reset()

func (*WitnessSubmissionResponse) String

func (x *WitnessSubmissionResponse) String() string

Jump to

Keyboard shortcuts

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