types

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "authority"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_" + ModuleName
)
View Source
const (
	// DefaultPolicyAddress is the default value for policy address
	DefaultPolicyAddress = "pell14r8nqy53kuruf7pp6aau3d8029ncxnwer54weg"
)
View Source
const (
	// PoliciesKey is the key for the policies store
	PoliciesKey = "Policies-value-"
)
View Source
const TypeMsgUpdatePolicies = "UpdatePolicies"

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 (
	ErrInvalidLengthPolicies        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPolicies          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPolicies = 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")
)
View Source
var ErrUnauthorized = errorsmod.Register(ModuleName, 1102, "sender not authorized")
View Source
var Msg_serviceDesc = _Msg_serviceDesc
View Source
var PolicyType_name = map[int32]string{
	0: "GROUP_EMERGENCY",
	1: "GROUP_OPERATIONAL",
	2: "GROUP_ADMIN",
}
View Source
var PolicyType_value = map[string]int32{
	"GROUP_EMERGENCY":   0,
	"GROUP_OPERATIONAL": 1,
	"GROUP_ADMIN":       2,
}
View Source
var Query_serviceDesc = _Query_serviceDesc

Functions

func KeyPrefix

func KeyPrefix(p string) []byte

KeyPrefix returns the store key prefix for the policies store

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

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

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

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

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

func RegisterQueryHandlerFromEndpoint

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

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

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer 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 RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type GenesisState

type GenesisState struct {
	Policies Policies `protobuf:"bytes,1,opt,name=policies,proto3" json:"policies"`
}

GenesisState defines the authority module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default authority genesis state

func (*GenesisState) Descriptor

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

func (*GenesisState) GetPolicies

func (m *GenesisState) GetPolicies() Policies

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

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

func (*GenesisState) XXX_Merge

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

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	// update policies
	UpdatePolicies(ctx context.Context, in *MsgUpdatePolicies, opts ...grpc.CallOption) (*MsgUpdatePoliciesResponse, 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 {
	// update policies
	UpdatePolicies(context.Context, *MsgUpdatePolicies) (*MsgUpdatePoliciesResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdatePolicies

type MsgUpdatePolicies struct {
	Signer   string   `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
	Policies Policies `protobuf:"bytes,2,opt,name=policies,proto3" json:"policies"`
}

MsgUpdatePolicies defines the MsgUpdatePolicies service.

func NewMsgUpdatePolicies

func NewMsgUpdatePolicies(signer string, policies Policies) *MsgUpdatePolicies

func (*MsgUpdatePolicies) Descriptor

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

func (*MsgUpdatePolicies) GetPolicies

func (m *MsgUpdatePolicies) GetPolicies() Policies

func (*MsgUpdatePolicies) GetSignBytes

func (msg *MsgUpdatePolicies) GetSignBytes() []byte

func (*MsgUpdatePolicies) GetSigner

func (m *MsgUpdatePolicies) GetSigner() string

func (*MsgUpdatePolicies) GetSigners

func (msg *MsgUpdatePolicies) GetSigners() []sdk.AccAddress

func (*MsgUpdatePolicies) Marshal

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

func (*MsgUpdatePolicies) MarshalTo

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

func (*MsgUpdatePolicies) MarshalToSizedBuffer

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

func (*MsgUpdatePolicies) ProtoMessage

func (*MsgUpdatePolicies) ProtoMessage()

func (*MsgUpdatePolicies) Reset

func (m *MsgUpdatePolicies) Reset()

func (*MsgUpdatePolicies) Route

func (msg *MsgUpdatePolicies) Route() string

func (*MsgUpdatePolicies) Size

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

func (*MsgUpdatePolicies) String

func (m *MsgUpdatePolicies) String() string

func (*MsgUpdatePolicies) Type

func (msg *MsgUpdatePolicies) Type() string

func (*MsgUpdatePolicies) Unmarshal

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

func (*MsgUpdatePolicies) ValidateBasic

func (msg *MsgUpdatePolicies) ValidateBasic() error

func (*MsgUpdatePolicies) XXX_DiscardUnknown

func (m *MsgUpdatePolicies) XXX_DiscardUnknown()

func (*MsgUpdatePolicies) XXX_Marshal

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

func (*MsgUpdatePolicies) XXX_Merge

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

func (*MsgUpdatePolicies) XXX_Size

func (m *MsgUpdatePolicies) XXX_Size() int

func (*MsgUpdatePolicies) XXX_Unmarshal

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

type MsgUpdatePoliciesResponse

type MsgUpdatePoliciesResponse struct {
}

MsgUpdatePoliciesResponse defines the MsgUpdatePoliciesResponse service.

func (*MsgUpdatePoliciesResponse) Descriptor

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

func (*MsgUpdatePoliciesResponse) Marshal

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

func (*MsgUpdatePoliciesResponse) MarshalTo

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

func (*MsgUpdatePoliciesResponse) MarshalToSizedBuffer

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

func (*MsgUpdatePoliciesResponse) ProtoMessage

func (*MsgUpdatePoliciesResponse) ProtoMessage()

func (*MsgUpdatePoliciesResponse) Reset

func (m *MsgUpdatePoliciesResponse) Reset()

func (*MsgUpdatePoliciesResponse) Size

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

func (*MsgUpdatePoliciesResponse) String

func (m *MsgUpdatePoliciesResponse) String() string

func (*MsgUpdatePoliciesResponse) Unmarshal

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

func (*MsgUpdatePoliciesResponse) XXX_DiscardUnknown

func (m *MsgUpdatePoliciesResponse) XXX_DiscardUnknown()

func (*MsgUpdatePoliciesResponse) XXX_Marshal

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

func (*MsgUpdatePoliciesResponse) XXX_Merge

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

func (*MsgUpdatePoliciesResponse) XXX_Size

func (m *MsgUpdatePoliciesResponse) XXX_Size() int

func (*MsgUpdatePoliciesResponse) XXX_Unmarshal

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

type Policies

type Policies struct {
	Items []*Policy `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
}

Policy contains info about authority policies

func DefaultPolicies

func DefaultPolicies() Policies

DefaultPolicies returns the default value for policies

func (*Policies) Descriptor

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

func (*Policies) GetItems

func (m *Policies) GetItems() []*Policy

func (*Policies) Marshal

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

func (*Policies) MarshalTo

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

func (*Policies) MarshalToSizedBuffer

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

func (*Policies) ProtoMessage

func (*Policies) ProtoMessage()

func (*Policies) Reset

func (m *Policies) Reset()

func (*Policies) Size

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

func (*Policies) String

func (m *Policies) String() string

func (*Policies) Unmarshal

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

func (Policies) Validate

func (p Policies) Validate() error

Validate performs basic validation of policies

func (*Policies) XXX_DiscardUnknown

func (m *Policies) XXX_DiscardUnknown()

func (*Policies) XXX_Marshal

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

func (*Policies) XXX_Merge

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

func (*Policies) XXX_Size

func (m *Policies) XXX_Size() int

func (*Policies) XXX_Unmarshal

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

type Policy

type Policy struct {
	PolicyType PolicyType `protobuf:"varint,1,opt,name=policy_type,json=policyType,proto3,enum=authority.PolicyType" json:"policy_type,omitempty"`
	Address    string     `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
}

authority policy item

func (*Policy) Descriptor

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

func (*Policy) GetAddress

func (m *Policy) GetAddress() string

func (*Policy) GetPolicyType

func (m *Policy) GetPolicyType() PolicyType

func (*Policy) Marshal

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

func (*Policy) MarshalTo

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

func (*Policy) MarshalToSizedBuffer

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

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) Reset

func (m *Policy) Reset()

func (*Policy) Size

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

func (*Policy) String

func (m *Policy) String() string

func (*Policy) Unmarshal

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

func (*Policy) XXX_DiscardUnknown

func (m *Policy) XXX_DiscardUnknown()

func (*Policy) XXX_Marshal

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

func (*Policy) XXX_Merge

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

func (*Policy) XXX_Size

func (m *Policy) XXX_Size() int

func (*Policy) XXX_Unmarshal

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

type PolicyType

type PolicyType int32

PolicyType defines the type of policy

const (
	// Used for emergency situations that require immediate action
	PolicyType_GROUP_EMERGENCY PolicyType = 0
	// Used for operational tasks like changing
	// non-sensitive protocol parameters
	PolicyType_GROUP_OPERATIONAL PolicyType = 1
	// Used for administrative tasks like changing sensitive
	// protocol parameters or moving funds
	PolicyType_GROUP_ADMIN PolicyType = 2
)

func (PolicyType) EnumDescriptor

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

func (PolicyType) String

func (x PolicyType) String() string

type QueryClient

type QueryClient interface {
	// Queries Policies
	Policies(ctx context.Context, in *QueryGetPoliciesRequest, opts ...grpc.CallOption) (*QueryPoliciesResponse, error)
}

QueryClient is the client API for Query service.

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

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryGetPoliciesRequest

type QueryGetPoliciesRequest struct {
}

QueryGetPoliciesRequest is the request type for the Query/Policies RPC method.

func (*QueryGetPoliciesRequest) Descriptor

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

func (*QueryGetPoliciesRequest) Marshal

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

func (*QueryGetPoliciesRequest) MarshalTo

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

func (*QueryGetPoliciesRequest) MarshalToSizedBuffer

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

func (*QueryGetPoliciesRequest) ProtoMessage

func (*QueryGetPoliciesRequest) ProtoMessage()

func (*QueryGetPoliciesRequest) Reset

func (m *QueryGetPoliciesRequest) Reset()

func (*QueryGetPoliciesRequest) Size

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

func (*QueryGetPoliciesRequest) String

func (m *QueryGetPoliciesRequest) String() string

func (*QueryGetPoliciesRequest) Unmarshal

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

func (*QueryGetPoliciesRequest) XXX_DiscardUnknown

func (m *QueryGetPoliciesRequest) XXX_DiscardUnknown()

func (*QueryGetPoliciesRequest) XXX_Marshal

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

func (*QueryGetPoliciesRequest) XXX_Merge

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

func (*QueryGetPoliciesRequest) XXX_Size

func (m *QueryGetPoliciesRequest) XXX_Size() int

func (*QueryGetPoliciesRequest) XXX_Unmarshal

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

type QueryPoliciesResponse

type QueryPoliciesResponse struct {
	Policies Policies `protobuf:"bytes,1,opt,name=policies,proto3" json:"policies"`
}

QueryGetPoliciesResponse is the response type for the Query/Policies RPC method.

func (*QueryPoliciesResponse) Descriptor

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

func (*QueryPoliciesResponse) GetPolicies

func (m *QueryPoliciesResponse) GetPolicies() Policies

func (*QueryPoliciesResponse) Marshal

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

func (*QueryPoliciesResponse) MarshalTo

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

func (*QueryPoliciesResponse) MarshalToSizedBuffer

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

func (*QueryPoliciesResponse) ProtoMessage

func (*QueryPoliciesResponse) ProtoMessage()

func (*QueryPoliciesResponse) Reset

func (m *QueryPoliciesResponse) Reset()

func (*QueryPoliciesResponse) Size

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

func (*QueryPoliciesResponse) String

func (m *QueryPoliciesResponse) String() string

func (*QueryPoliciesResponse) Unmarshal

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

func (*QueryPoliciesResponse) XXX_DiscardUnknown

func (m *QueryPoliciesResponse) XXX_DiscardUnknown()

func (*QueryPoliciesResponse) XXX_Marshal

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

func (*QueryPoliciesResponse) XXX_Merge

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

func (*QueryPoliciesResponse) XXX_Size

func (m *QueryPoliciesResponse) XXX_Size() int

func (*QueryPoliciesResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Queries Policies
	Policies(context.Context, *QueryGetPoliciesRequest) (*QueryPoliciesResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdatePolicies

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Policies

Jump to

Keyboard shortcuts

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