transactionv1

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package transactionv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TransactionService_Ping_FullMethodName   = "/transaction.v1.TransactionService/Ping"
	TransactionService_Submit_FullMethodName = "/transaction.v1.TransactionService/Submit"
)

Variables

View Source
var File_transaction_v1_transaction_proto protoreflect.FileDescriptor
View Source
var TransactionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "transaction.v1.TransactionService",
	HandlerType: (*TransactionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ping",
			Handler:    _TransactionService_Ping_Handler,
		},
		{
			MethodName: "Submit",
			Handler:    _TransactionService_Submit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "transaction/v1/transaction.proto",
}

TransactionService_ServiceDesc is the grpc.ServiceDesc for TransactionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTransactionServiceHandler

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

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

func RegisterTransactionServiceHandlerClient

func RegisterTransactionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TransactionServiceClient) error

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

func RegisterTransactionServiceHandlerFromEndpoint

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

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

func RegisterTransactionServiceHandlerServer

func RegisterTransactionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TransactionServiceServer) error

RegisterTransactionServiceHandlerServer registers the http handlers for service TransactionService to "mux". UnaryRPC :call TransactionServiceServer 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 RegisterTransactionServiceHandlerFromEndpoint instead.

func RegisterTransactionServiceServer

func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer)

Types

type SubmitRequest

type SubmitRequest struct {
	From        string       `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	Contract    string       `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"`
	Transaction *Transaction `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

func (*SubmitRequest) Descriptor deprecated

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

Deprecated: Use SubmitRequest.ProtoReflect.Descriptor instead.

func (*SubmitRequest) GetContract

func (x *SubmitRequest) GetContract() string

func (*SubmitRequest) GetFrom

func (x *SubmitRequest) GetFrom() string

func (*SubmitRequest) GetTransaction

func (x *SubmitRequest) GetTransaction() *Transaction

func (*SubmitRequest) ProtoMessage

func (*SubmitRequest) ProtoMessage()

func (*SubmitRequest) ProtoReflect

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

func (*SubmitRequest) Reset

func (x *SubmitRequest) Reset()

func (*SubmitRequest) String

func (x *SubmitRequest) String() string

func (*SubmitRequest) Validate

func (m *SubmitRequest) Validate() error

Validate checks the field values on SubmitRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*SubmitRequest) ValidateAll

func (m *SubmitRequest) ValidateAll() error

ValidateAll checks the field values on SubmitRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubmitRequestMultiError, or nil if none found.

type SubmitRequestMultiError

type SubmitRequestMultiError []error

SubmitRequestMultiError is an error wrapping multiple validation errors returned by SubmitRequest.ValidateAll() if the designated constraints aren't met.

func (SubmitRequestMultiError) AllErrors

func (m SubmitRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SubmitRequestMultiError) Error

func (m SubmitRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SubmitRequestValidationError

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

SubmitRequestValidationError is the validation error returned by SubmitRequest.Validate if the designated constraints aren't met.

func (SubmitRequestValidationError) Cause

Cause function returns cause value.

func (SubmitRequestValidationError) Error

Error satisfies the builtin error interface

func (SubmitRequestValidationError) ErrorName

func (e SubmitRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SubmitRequestValidationError) Field

Field function returns field value.

func (SubmitRequestValidationError) Key

Key function returns key value.

func (SubmitRequestValidationError) Reason

Reason function returns reason value.

type SubmitResponse

type SubmitResponse struct {
	Hash         *string `protobuf:"bytes,1,opt,name=hash,proto3,oneof" json:"hash,omitempty"`
	RejectReason *string `protobuf:"bytes,2,opt,name=reject_reason,json=rejectReason,proto3,oneof" json:"reject_reason,omitempty"`
	// contains filtered or unexported fields
}

func (*SubmitResponse) Descriptor deprecated

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

Deprecated: Use SubmitResponse.ProtoReflect.Descriptor instead.

func (*SubmitResponse) GetHash

func (x *SubmitResponse) GetHash() string

func (*SubmitResponse) GetRejectReason

func (x *SubmitResponse) GetRejectReason() string

func (*SubmitResponse) ProtoMessage

func (*SubmitResponse) ProtoMessage()

func (*SubmitResponse) ProtoReflect

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

func (*SubmitResponse) Reset

func (x *SubmitResponse) Reset()

func (*SubmitResponse) String

func (x *SubmitResponse) String() string

func (*SubmitResponse) Validate

func (m *SubmitResponse) Validate() error

Validate checks the field values on SubmitResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*SubmitResponse) ValidateAll

func (m *SubmitResponse) ValidateAll() error

ValidateAll checks the field values on SubmitResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubmitResponseMultiError, or nil if none found.

type SubmitResponseMultiError

type SubmitResponseMultiError []error

SubmitResponseMultiError is an error wrapping multiple validation errors returned by SubmitResponse.ValidateAll() if the designated constraints aren't met.

func (SubmitResponseMultiError) AllErrors

func (m SubmitResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SubmitResponseMultiError) Error

func (m SubmitResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SubmitResponseValidationError

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

SubmitResponseValidationError is the validation error returned by SubmitResponse.Validate if the designated constraints aren't met.

func (SubmitResponseValidationError) Cause

Cause function returns cause value.

func (SubmitResponseValidationError) Error

Error satisfies the builtin error interface

func (SubmitResponseValidationError) ErrorName

func (e SubmitResponseValidationError) ErrorName() string

ErrorName returns error name.

func (SubmitResponseValidationError) Field

Field function returns field value.

func (SubmitResponseValidationError) Key

Key function returns key value.

func (SubmitResponseValidationError) Reason

Reason function returns reason value.

type Transaction

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

func (*Transaction) Descriptor deprecated

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

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

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

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

func (*Transaction) Validate

func (m *Transaction) Validate() error

Validate checks the field values on Transaction with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Transaction) ValidateAll

func (m *Transaction) ValidateAll() error

ValidateAll checks the field values on Transaction with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TransactionMultiError, or nil if none found.

type TransactionMultiError

type TransactionMultiError []error

TransactionMultiError is an error wrapping multiple validation errors returned by Transaction.ValidateAll() if the designated constraints aren't met.

func (TransactionMultiError) AllErrors

func (m TransactionMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransactionMultiError) Error

func (m TransactionMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type TransactionServiceClient

type TransactionServiceClient interface {
	Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*v1.BoolResponse, error)
	Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error)
}

TransactionServiceClient is the client API for TransactionService 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 TransactionServiceServer

type TransactionServiceServer interface {
	Ping(context.Context, *emptypb.Empty) (*v1.BoolResponse, error)
	Submit(context.Context, *SubmitRequest) (*SubmitResponse, error)
	// contains filtered or unexported methods
}

TransactionServiceServer is the server API for TransactionService service. All implementations must embed UnimplementedTransactionServiceServer for forward compatibility

type TransactionValidationError

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

TransactionValidationError is the validation error returned by Transaction.Validate if the designated constraints aren't met.

func (TransactionValidationError) Cause

Cause function returns cause value.

func (TransactionValidationError) Error

Error satisfies the builtin error interface

func (TransactionValidationError) ErrorName

func (e TransactionValidationError) ErrorName() string

ErrorName returns error name.

func (TransactionValidationError) Field

Field function returns field value.

func (TransactionValidationError) Key

Key function returns key value.

func (TransactionValidationError) Reason

Reason function returns reason value.

type UnimplementedTransactionServiceServer

type UnimplementedTransactionServiceServer struct {
}

UnimplementedTransactionServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTransactionServiceServer) Ping

func (UnimplementedTransactionServiceServer) Submit

type UnsafeTransactionServiceServer

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

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

Jump to

Keyboard shortcuts

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