types

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: LGPL-3.0 Imports: 26 Imported by: 1

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const ModuleName = "namespace"

Variables

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers the client interfaces to protobuf Any.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServiceHandler

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

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

func RegisterQueryServiceHandlerClient

func RegisterQueryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryServiceClient) error

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

func RegisterQueryServiceHandlerFromEndpoint

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

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

func RegisterQueryServiceHandlerServer

func RegisterQueryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServiceServer) error

RegisterQueryServiceHandlerServer registers the http handlers for service QueryService to "mux". UnaryRPC :call QueryServiceServer 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 RegisterQueryServiceHandlerFromEndpoint instead.

func RegisterQueryServiceServer

func RegisterQueryServiceServer(s grpc1.Server, srv QueryServiceServer)

Types

type AddressRequest

type AddressRequest struct {
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
}

func (*AddressRequest) Descriptor

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

func (*AddressRequest) GetNamespace

func (m *AddressRequest) GetNamespace() string

func (*AddressRequest) Marshal

func (m *AddressRequest) Marshal() (dAtA []byte, err error)

func (*AddressRequest) MarshalTo

func (m *AddressRequest) MarshalTo(dAtA []byte) (int, error)

func (*AddressRequest) MarshalToSizedBuffer

func (m *AddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AddressRequest) ProtoMessage

func (*AddressRequest) ProtoMessage()

func (*AddressRequest) Reset

func (m *AddressRequest) Reset()

func (*AddressRequest) Size

func (m *AddressRequest) Size() (n int)

func (*AddressRequest) String

func (m *AddressRequest) String() string

func (*AddressRequest) Unmarshal

func (m *AddressRequest) Unmarshal(dAtA []byte) error

func (*AddressRequest) XXX_DiscardUnknown

func (m *AddressRequest) XXX_DiscardUnknown()

func (*AddressRequest) XXX_Marshal

func (m *AddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddressRequest) XXX_Merge

func (m *AddressRequest) XXX_Merge(src proto.Message)

func (*AddressRequest) XXX_Size

func (m *AddressRequest) XXX_Size() int

func (*AddressRequest) XXX_Unmarshal

func (m *AddressRequest) XXX_Unmarshal(b []byte) error

type AddressResponse

type AddressResponse struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

func (*AddressResponse) Descriptor

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

func (*AddressResponse) GetAddress

func (m *AddressResponse) GetAddress() string

func (*AddressResponse) Marshal

func (m *AddressResponse) Marshal() (dAtA []byte, err error)

func (*AddressResponse) MarshalTo

func (m *AddressResponse) MarshalTo(dAtA []byte) (int, error)

func (*AddressResponse) MarshalToSizedBuffer

func (m *AddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AddressResponse) ProtoMessage

func (*AddressResponse) ProtoMessage()

func (*AddressResponse) Reset

func (m *AddressResponse) Reset()

func (*AddressResponse) Size

func (m *AddressResponse) Size() (n int)

func (*AddressResponse) String

func (m *AddressResponse) String() string

func (*AddressResponse) Unmarshal

func (m *AddressResponse) Unmarshal(dAtA []byte) error

func (*AddressResponse) XXX_DiscardUnknown

func (m *AddressResponse) XXX_DiscardUnknown()

func (*AddressResponse) XXX_Marshal

func (m *AddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddressResponse) XXX_Merge

func (m *AddressResponse) XXX_Merge(src proto.Message)

func (*AddressResponse) XXX_Size

func (m *AddressResponse) XXX_Size() int

func (*AddressResponse) XXX_Unmarshal

func (m *AddressResponse) XXX_Unmarshal(b []byte) error

type Genesis

type Genesis struct {
	Namespaces []*Namespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
}

func DefaultGenesis

func DefaultGenesis() *Genesis

func (*Genesis) Descriptor

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

func (*Genesis) GetNamespaces

func (m *Genesis) GetNamespaces() []*Namespace

func (*Genesis) Marshal

func (m *Genesis) Marshal() (dAtA []byte, err error)

func (*Genesis) MarshalTo

func (m *Genesis) MarshalTo(dAtA []byte) (int, error)

func (*Genesis) MarshalToSizedBuffer

func (m *Genesis) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Genesis) ProtoMessage

func (*Genesis) ProtoMessage()

func (*Genesis) Reset

func (m *Genesis) Reset()

func (*Genesis) Size

func (m *Genesis) Size() (n int)

func (*Genesis) String

func (m *Genesis) String() string

func (*Genesis) Unmarshal

func (m *Genesis) Unmarshal(dAtA []byte) error

func (*Genesis) Validate

func (g *Genesis) Validate() error

func (*Genesis) XXX_DiscardUnknown

func (m *Genesis) XXX_DiscardUnknown()

func (*Genesis) XXX_Marshal

func (m *Genesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Genesis) XXX_Merge

func (m *Genesis) XXX_Merge(src proto.Message)

func (*Genesis) XXX_Size

func (m *Genesis) XXX_Size() int

func (*Genesis) XXX_Unmarshal

func (m *Genesis) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	UpdateNamespace(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	UpdateNamespace(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error)
}

MsgServer is the server API for Msg service.

type Namespace

type Namespace struct {
	// shard_name is the name of the shard (i.e. darkforest1)
	ShardName string `protobuf:"bytes,1,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
	// shard_address is the gRPC address the shard runs at (i.e. 127.0.0.1:51835)
	ShardAddress string `protobuf:"bytes,2,opt,name=shard_address,json=shardAddress,proto3" json:"shard_address,omitempty"`
}

func (*Namespace) Descriptor

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

func (*Namespace) GetShardAddress

func (m *Namespace) GetShardAddress() string

func (*Namespace) GetShardName

func (m *Namespace) GetShardName() string

func (*Namespace) Marshal

func (m *Namespace) Marshal() (dAtA []byte, err error)

func (*Namespace) MarshalTo

func (m *Namespace) MarshalTo(dAtA []byte) (int, error)

func (*Namespace) MarshalToSizedBuffer

func (m *Namespace) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Namespace) ProtoMessage

func (*Namespace) ProtoMessage()

func (*Namespace) Reset

func (m *Namespace) Reset()

func (*Namespace) Size

func (m *Namespace) Size() (n int)

func (*Namespace) String

func (m *Namespace) String() string

func (*Namespace) Unmarshal

func (m *Namespace) Unmarshal(dAtA []byte) error

func (*Namespace) Validate

func (ns *Namespace) Validate() error

func (*Namespace) XXX_DiscardUnknown

func (m *Namespace) XXX_DiscardUnknown()

func (*Namespace) XXX_Marshal

func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Namespace) XXX_Merge

func (m *Namespace) XXX_Merge(src proto.Message)

func (*Namespace) XXX_Size

func (m *Namespace) XXX_Size() int

func (*Namespace) XXX_Unmarshal

func (m *Namespace) XXX_Unmarshal(b []byte) error

type NamespacesRequest

type NamespacesRequest struct {
}

func (*NamespacesRequest) Descriptor

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

func (*NamespacesRequest) Marshal

func (m *NamespacesRequest) Marshal() (dAtA []byte, err error)

func (*NamespacesRequest) MarshalTo

func (m *NamespacesRequest) MarshalTo(dAtA []byte) (int, error)

func (*NamespacesRequest) MarshalToSizedBuffer

func (m *NamespacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*NamespacesRequest) ProtoMessage

func (*NamespacesRequest) ProtoMessage()

func (*NamespacesRequest) Reset

func (m *NamespacesRequest) Reset()

func (*NamespacesRequest) Size

func (m *NamespacesRequest) Size() (n int)

func (*NamespacesRequest) String

func (m *NamespacesRequest) String() string

func (*NamespacesRequest) Unmarshal

func (m *NamespacesRequest) Unmarshal(dAtA []byte) error

func (*NamespacesRequest) XXX_DiscardUnknown

func (m *NamespacesRequest) XXX_DiscardUnknown()

func (*NamespacesRequest) XXX_Marshal

func (m *NamespacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NamespacesRequest) XXX_Merge

func (m *NamespacesRequest) XXX_Merge(src proto.Message)

func (*NamespacesRequest) XXX_Size

func (m *NamespacesRequest) XXX_Size() int

func (*NamespacesRequest) XXX_Unmarshal

func (m *NamespacesRequest) XXX_Unmarshal(b []byte) error

type NamespacesResponse

type NamespacesResponse struct {
	Namespaces []*Namespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
}

func (*NamespacesResponse) Descriptor

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

func (*NamespacesResponse) GetNamespaces

func (m *NamespacesResponse) GetNamespaces() []*Namespace

func (*NamespacesResponse) Marshal

func (m *NamespacesResponse) Marshal() (dAtA []byte, err error)

func (*NamespacesResponse) MarshalTo

func (m *NamespacesResponse) MarshalTo(dAtA []byte) (int, error)

func (*NamespacesResponse) MarshalToSizedBuffer

func (m *NamespacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*NamespacesResponse) ProtoMessage

func (*NamespacesResponse) ProtoMessage()

func (*NamespacesResponse) Reset

func (m *NamespacesResponse) Reset()

func (*NamespacesResponse) Size

func (m *NamespacesResponse) Size() (n int)

func (*NamespacesResponse) String

func (m *NamespacesResponse) String() string

func (*NamespacesResponse) Unmarshal

func (m *NamespacesResponse) Unmarshal(dAtA []byte) error

func (*NamespacesResponse) XXX_DiscardUnknown

func (m *NamespacesResponse) XXX_DiscardUnknown()

func (*NamespacesResponse) XXX_Marshal

func (m *NamespacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NamespacesResponse) XXX_Merge

func (m *NamespacesResponse) XXX_Merge(src proto.Message)

func (*NamespacesResponse) XXX_Size

func (m *NamespacesResponse) XXX_Size() int

func (*NamespacesResponse) XXX_Unmarshal

func (m *NamespacesResponse) XXX_Unmarshal(b []byte) error

type QueryServiceClient

type QueryServiceClient interface {
	// Namespaces returns all the namespace:address pairs.
	Namespaces(ctx context.Context, in *NamespacesRequest, opts ...grpc.CallOption) (*NamespacesResponse, error)
	// Address returns the address for a given namespace.
	Address(ctx context.Context, in *AddressRequest, opts ...grpc.CallOption) (*AddressResponse, error)
}

QueryServiceClient is the client API for QueryService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryServiceClient

func NewQueryServiceClient(cc grpc1.ClientConn) QueryServiceClient

type QueryServiceServer

type QueryServiceServer interface {
	// Namespaces returns all the namespace:address pairs.
	Namespaces(context.Context, *NamespacesRequest) (*NamespacesResponse, error)
	// Address returns the address for a given namespace.
	Address(context.Context, *AddressRequest) (*AddressResponse, error)
}

QueryServiceServer is the server API for QueryService service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdateNamespace

type UnimplementedQueryServiceServer

type UnimplementedQueryServiceServer struct {
}

UnimplementedQueryServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServiceServer) Address

func (*UnimplementedQueryServiceServer) Namespaces

type UpdateNamespaceRequest

type UpdateNamespaceRequest struct {
	// authority is the address that controls the module (defaults to x/gov unless overwritten).
	Authority string     `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	Namespace *Namespace `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
}

`UpdateNamespaceRequest` is the Msg/UpdateNamespace request type.

func (*UpdateNamespaceRequest) Descriptor

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

func (*UpdateNamespaceRequest) GetAuthority

func (m *UpdateNamespaceRequest) GetAuthority() string

func (*UpdateNamespaceRequest) GetNamespace

func (m *UpdateNamespaceRequest) GetNamespace() *Namespace

func (*UpdateNamespaceRequest) Marshal

func (m *UpdateNamespaceRequest) Marshal() (dAtA []byte, err error)

func (*UpdateNamespaceRequest) MarshalTo

func (m *UpdateNamespaceRequest) MarshalTo(dAtA []byte) (int, error)

func (*UpdateNamespaceRequest) MarshalToSizedBuffer

func (m *UpdateNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UpdateNamespaceRequest) ProtoMessage

func (*UpdateNamespaceRequest) ProtoMessage()

func (*UpdateNamespaceRequest) Reset

func (m *UpdateNamespaceRequest) Reset()

func (*UpdateNamespaceRequest) Size

func (m *UpdateNamespaceRequest) Size() (n int)

func (*UpdateNamespaceRequest) String

func (m *UpdateNamespaceRequest) String() string

func (*UpdateNamespaceRequest) Unmarshal

func (m *UpdateNamespaceRequest) Unmarshal(dAtA []byte) error

func (*UpdateNamespaceRequest) ValidateBasic

func (m *UpdateNamespaceRequest) ValidateBasic() error

func (*UpdateNamespaceRequest) XXX_DiscardUnknown

func (m *UpdateNamespaceRequest) XXX_DiscardUnknown()

func (*UpdateNamespaceRequest) XXX_Marshal

func (m *UpdateNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateNamespaceRequest) XXX_Merge

func (m *UpdateNamespaceRequest) XXX_Merge(src proto.Message)

func (*UpdateNamespaceRequest) XXX_Size

func (m *UpdateNamespaceRequest) XXX_Size() int

func (*UpdateNamespaceRequest) XXX_Unmarshal

func (m *UpdateNamespaceRequest) XXX_Unmarshal(b []byte) error

type UpdateNamespaceResponse

type UpdateNamespaceResponse struct {
}

`UpdateNamespaceResponse` defines the response structure for executing a UpdateNamespaceResponse message.

func (*UpdateNamespaceResponse) Descriptor

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

func (*UpdateNamespaceResponse) Marshal

func (m *UpdateNamespaceResponse) Marshal() (dAtA []byte, err error)

func (*UpdateNamespaceResponse) MarshalTo

func (m *UpdateNamespaceResponse) MarshalTo(dAtA []byte) (int, error)

func (*UpdateNamespaceResponse) MarshalToSizedBuffer

func (m *UpdateNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UpdateNamespaceResponse) ProtoMessage

func (*UpdateNamespaceResponse) ProtoMessage()

func (*UpdateNamespaceResponse) Reset

func (m *UpdateNamespaceResponse) Reset()

func (*UpdateNamespaceResponse) Size

func (m *UpdateNamespaceResponse) Size() (n int)

func (*UpdateNamespaceResponse) String

func (m *UpdateNamespaceResponse) String() string

func (*UpdateNamespaceResponse) Unmarshal

func (m *UpdateNamespaceResponse) Unmarshal(dAtA []byte) error

func (*UpdateNamespaceResponse) XXX_DiscardUnknown

func (m *UpdateNamespaceResponse) XXX_DiscardUnknown()

func (*UpdateNamespaceResponse) XXX_Marshal

func (m *UpdateNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateNamespaceResponse) XXX_Merge

func (m *UpdateNamespaceResponse) XXX_Merge(src proto.Message)

func (*UpdateNamespaceResponse) XXX_Size

func (m *UpdateNamespaceResponse) XXX_Size() int

func (*UpdateNamespaceResponse) XXX_Unmarshal

func (m *UpdateNamespaceResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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