v1

package
v0.0.0-...-701c789 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var AssetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pkg.pbs.asset.v1.AssetService",
	HandlerType: (*AssetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListAssets",
			Handler:    _AssetService_ListAssets_Handler,
		},
		{
			MethodName: "GetAsset",
			Handler:    _AssetService_GetAsset_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/pbs/asset/v1/asset.proto",
}

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

View Source
var File_pkg_pbs_asset_v1_asset_proto protoreflect.FileDescriptor

Functions

func RegisterAssetServiceHandler

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

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

func RegisterAssetServiceHandlerClient

func RegisterAssetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AssetServiceClient) error

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

func RegisterAssetServiceHandlerFromEndpoint

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

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

func RegisterAssetServiceHandlerServer

func RegisterAssetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AssetServiceServer) error

RegisterAssetServiceHandlerServer registers the http handlers for service AssetService to "mux". UnaryRPC :call AssetServiceServer 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 RegisterAssetServiceHandlerFromEndpoint instead.

func RegisterAssetServiceServer

func RegisterAssetServiceServer(s grpc.ServiceRegistrar, srv AssetServiceServer)

Types

type Asset

type Asset struct {
	AssetId              string                 `protobuf:"bytes,1,opt,name=assetId,proto3" json:"assetId,omitempty"`
	Ticker               string                 `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"`
	Name                 string                 `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	MinTransactionAmount string                 `protobuf:"bytes,4,opt,name=minTransactionAmount,proto3" json:"minTransactionAmount,omitempty"`
	MaxTransactionAmount string                 `protobuf:"bytes,5,opt,name=maxTransactionAmount,proto3" json:"maxTransactionAmount,omitempty"`
	HighOffer            string                 `protobuf:"bytes,6,opt,name=highOffer,proto3" json:"highOffer,omitempty"`
	LowBid               string                 `protobuf:"bytes,7,opt,name=lowBid,proto3" json:"lowBid,omitempty"`
	Slippage             string                 `protobuf:"bytes,8,opt,name=slippage,proto3" json:"slippage,omitempty"`
	Spread               string                 `protobuf:"bytes,9,opt,name=spread,proto3" json:"spread,omitempty"`
	CreatedAt            *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	MarketCap            string                 `protobuf:"bytes,11,opt,name=marketCap,proto3" json:"marketCap,omitempty"`
	Volume               string                 `protobuf:"bytes,12,opt,name=volume,proto3" json:"volume,omitempty"`
	Supply               string                 `protobuf:"bytes,13,opt,name=supply,proto3" json:"supply,omitempty"`
	Direction            string                 `protobuf:"bytes,14,opt,name=direction,proto3" json:"direction,omitempty"`
	// contains filtered or unexported fields
}

func (*Asset) Descriptor deprecated

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

Deprecated: Use Asset.ProtoReflect.Descriptor instead.

func (*Asset) GetAssetId

func (x *Asset) GetAssetId() string

func (*Asset) GetCreatedAt

func (x *Asset) GetCreatedAt() *timestamppb.Timestamp

func (*Asset) GetDirection

func (x *Asset) GetDirection() string

func (*Asset) GetHighOffer

func (x *Asset) GetHighOffer() string

func (*Asset) GetLowBid

func (x *Asset) GetLowBid() string

func (*Asset) GetMarketCap

func (x *Asset) GetMarketCap() string

func (*Asset) GetMaxTransactionAmount

func (x *Asset) GetMaxTransactionAmount() string

func (*Asset) GetMinTransactionAmount

func (x *Asset) GetMinTransactionAmount() string

func (*Asset) GetName

func (x *Asset) GetName() string

func (*Asset) GetSlippage

func (x *Asset) GetSlippage() string

func (*Asset) GetSpread

func (x *Asset) GetSpread() string

func (*Asset) GetSupply

func (x *Asset) GetSupply() string

func (*Asset) GetTicker

func (x *Asset) GetTicker() string

func (*Asset) GetVolume

func (x *Asset) GetVolume() string

func (*Asset) ProtoMessage

func (*Asset) ProtoMessage()

func (*Asset) ProtoReflect

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

func (*Asset) Reset

func (x *Asset) Reset()

func (*Asset) String

func (x *Asset) String() string

func (*Asset) Validate

func (m *Asset) Validate() error

Validate checks the field values on Asset 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 (*Asset) ValidateAll

func (m *Asset) ValidateAll() error

ValidateAll checks the field values on Asset 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 AssetMultiError, or nil if none found.

type AssetMultiError

type AssetMultiError []error

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

func (AssetMultiError) AllErrors

func (m AssetMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AssetMultiError) Error

func (m AssetMultiError) Error() string

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

type AssetServiceClient

type AssetServiceClient interface {
	ListAssets(ctx context.Context, in *ListAssetsRequest, opts ...grpc.CallOption) (*ListAssetsResponse, error)
	GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*GetAssetResponse, error)
}

AssetServiceClient is the client API for AssetService 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 AssetServiceServer

type AssetServiceServer interface {
	ListAssets(context.Context, *ListAssetsRequest) (*ListAssetsResponse, error)
	GetAsset(context.Context, *GetAssetRequest) (*GetAssetResponse, error)
	// contains filtered or unexported methods
}

AssetServiceServer is the server API for AssetService service. All implementations must embed UnimplementedAssetServiceServer for forward compatibility

type AssetValidationError

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

AssetValidationError is the validation error returned by Asset.Validate if the designated constraints aren't met.

func (AssetValidationError) Cause

func (e AssetValidationError) Cause() error

Cause function returns cause value.

func (AssetValidationError) Error

func (e AssetValidationError) Error() string

Error satisfies the builtin error interface

func (AssetValidationError) ErrorName

func (e AssetValidationError) ErrorName() string

ErrorName returns error name.

func (AssetValidationError) Field

func (e AssetValidationError) Field() string

Field function returns field value.

func (AssetValidationError) Key

func (e AssetValidationError) Key() bool

Key function returns key value.

func (AssetValidationError) Reason

func (e AssetValidationError) Reason() string

Reason function returns reason value.

type GetAssetRequest

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

func (*GetAssetRequest) Descriptor deprecated

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

Deprecated: Use GetAssetRequest.ProtoReflect.Descriptor instead.

func (*GetAssetRequest) GetId

func (x *GetAssetRequest) GetId() string

func (*GetAssetRequest) ProtoMessage

func (*GetAssetRequest) ProtoMessage()

func (*GetAssetRequest) ProtoReflect

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

func (*GetAssetRequest) Reset

func (x *GetAssetRequest) Reset()

func (*GetAssetRequest) String

func (x *GetAssetRequest) String() string

func (*GetAssetRequest) Validate

func (m *GetAssetRequest) Validate() error

Validate checks the field values on GetAssetRequest 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 (*GetAssetRequest) ValidateAll

func (m *GetAssetRequest) ValidateAll() error

ValidateAll checks the field values on GetAssetRequest 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 GetAssetRequestMultiError, or nil if none found.

type GetAssetRequestMultiError

type GetAssetRequestMultiError []error

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

func (GetAssetRequestMultiError) AllErrors

func (m GetAssetRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetAssetRequestMultiError) Error

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

type GetAssetRequestValidationError

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

GetAssetRequestValidationError is the validation error returned by GetAssetRequest.Validate if the designated constraints aren't met.

func (GetAssetRequestValidationError) Cause

Cause function returns cause value.

func (GetAssetRequestValidationError) Error

Error satisfies the builtin error interface

func (GetAssetRequestValidationError) ErrorName

func (e GetAssetRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetAssetRequestValidationError) Field

Field function returns field value.

func (GetAssetRequestValidationError) Key

Key function returns key value.

func (GetAssetRequestValidationError) Reason

Reason function returns reason value.

type GetAssetResponse

type GetAssetResponse struct {
	Data *Asset `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAssetResponse) Descriptor deprecated

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

Deprecated: Use GetAssetResponse.ProtoReflect.Descriptor instead.

func (*GetAssetResponse) GetData

func (x *GetAssetResponse) GetData() *Asset

func (*GetAssetResponse) ProtoMessage

func (*GetAssetResponse) ProtoMessage()

func (*GetAssetResponse) ProtoReflect

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

func (*GetAssetResponse) Reset

func (x *GetAssetResponse) Reset()

func (*GetAssetResponse) String

func (x *GetAssetResponse) String() string

func (*GetAssetResponse) Validate

func (m *GetAssetResponse) Validate() error

Validate checks the field values on GetAssetResponse 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 (*GetAssetResponse) ValidateAll

func (m *GetAssetResponse) ValidateAll() error

ValidateAll checks the field values on GetAssetResponse 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 GetAssetResponseMultiError, or nil if none found.

type GetAssetResponseMultiError

type GetAssetResponseMultiError []error

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

func (GetAssetResponseMultiError) AllErrors

func (m GetAssetResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetAssetResponseMultiError) Error

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

type GetAssetResponseValidationError

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

GetAssetResponseValidationError is the validation error returned by GetAssetResponse.Validate if the designated constraints aren't met.

func (GetAssetResponseValidationError) Cause

Cause function returns cause value.

func (GetAssetResponseValidationError) Error

Error satisfies the builtin error interface

func (GetAssetResponseValidationError) ErrorName

ErrorName returns error name.

func (GetAssetResponseValidationError) Field

Field function returns field value.

func (GetAssetResponseValidationError) Key

Key function returns key value.

func (GetAssetResponseValidationError) Reason

Reason function returns reason value.

type ListAssetsRequest

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

func (*ListAssetsRequest) Descriptor deprecated

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

Deprecated: Use ListAssetsRequest.ProtoReflect.Descriptor instead.

func (*ListAssetsRequest) ProtoMessage

func (*ListAssetsRequest) ProtoMessage()

func (*ListAssetsRequest) ProtoReflect

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

func (*ListAssetsRequest) Reset

func (x *ListAssetsRequest) Reset()

func (*ListAssetsRequest) String

func (x *ListAssetsRequest) String() string

func (*ListAssetsRequest) Validate

func (m *ListAssetsRequest) Validate() error

Validate checks the field values on ListAssetsRequest 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 (*ListAssetsRequest) ValidateAll

func (m *ListAssetsRequest) ValidateAll() error

ValidateAll checks the field values on ListAssetsRequest 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 ListAssetsRequestMultiError, or nil if none found.

type ListAssetsRequestMultiError

type ListAssetsRequestMultiError []error

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

func (ListAssetsRequestMultiError) AllErrors

func (m ListAssetsRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListAssetsRequestMultiError) Error

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

type ListAssetsRequestValidationError

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

ListAssetsRequestValidationError is the validation error returned by ListAssetsRequest.Validate if the designated constraints aren't met.

func (ListAssetsRequestValidationError) Cause

Cause function returns cause value.

func (ListAssetsRequestValidationError) Error

Error satisfies the builtin error interface

func (ListAssetsRequestValidationError) ErrorName

ErrorName returns error name.

func (ListAssetsRequestValidationError) Field

Field function returns field value.

func (ListAssetsRequestValidationError) Key

Key function returns key value.

func (ListAssetsRequestValidationError) Reason

Reason function returns reason value.

type ListAssetsResponse

type ListAssetsResponse struct {
	Data []*Asset `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ListAssetsResponse) Descriptor deprecated

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

Deprecated: Use ListAssetsResponse.ProtoReflect.Descriptor instead.

func (*ListAssetsResponse) GetData

func (x *ListAssetsResponse) GetData() []*Asset

func (*ListAssetsResponse) ProtoMessage

func (*ListAssetsResponse) ProtoMessage()

func (*ListAssetsResponse) ProtoReflect

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

func (*ListAssetsResponse) Reset

func (x *ListAssetsResponse) Reset()

func (*ListAssetsResponse) String

func (x *ListAssetsResponse) String() string

func (*ListAssetsResponse) Validate

func (m *ListAssetsResponse) Validate() error

Validate checks the field values on ListAssetsResponse 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 (*ListAssetsResponse) ValidateAll

func (m *ListAssetsResponse) ValidateAll() error

ValidateAll checks the field values on ListAssetsResponse 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 ListAssetsResponseMultiError, or nil if none found.

type ListAssetsResponseMultiError

type ListAssetsResponseMultiError []error

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

func (ListAssetsResponseMultiError) AllErrors

func (m ListAssetsResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListAssetsResponseMultiError) Error

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

type ListAssetsResponseValidationError

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

ListAssetsResponseValidationError is the validation error returned by ListAssetsResponse.Validate if the designated constraints aren't met.

func (ListAssetsResponseValidationError) Cause

Cause function returns cause value.

func (ListAssetsResponseValidationError) Error

Error satisfies the builtin error interface

func (ListAssetsResponseValidationError) ErrorName

ErrorName returns error name.

func (ListAssetsResponseValidationError) Field

Field function returns field value.

func (ListAssetsResponseValidationError) Key

Key function returns key value.

func (ListAssetsResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedAssetServiceServer

type UnimplementedAssetServiceServer struct {
}

UnimplementedAssetServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAssetServiceServer) GetAsset

func (UnimplementedAssetServiceServer) ListAssets

type UnsafeAssetServiceServer

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

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

Jump to

Keyboard shortcuts

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