pb

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ModuleName = "sudo"
)

Variables

View Source
var (
	ErrInvalidLengthEvent        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvent          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// StoreKey defines the primary module store key.
	StoreKey = ModuleName

	MemStoreKey = "mem_" + ModuleName

	// RouterKey is the message route for transactions.
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key.
	QuerierRoute = ModuleName
)
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 (
	ErrInvalidLengthState        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowState          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupState = 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 ROOT_ACTION = struct {
	AddContracts    string
	RemoveContracts string
}{
	AddContracts:    "add_contracts",
	RemoveContracts: "remove_contracts",
}

ROOT_ACTION is an enum-like struct for each available action type.

View Source
var ROOT_ACTIONS = set.New(
	ROOT_ACTION.AddContracts,
	ROOT_ACTION.RemoveContracts,
)

ROOT_ACTIONS set[string]: The set of all root actions.

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgHandler

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

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

func RegisterMsgHandlerClient

func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error

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

func RegisterMsgHandlerFromEndpoint

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

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

func RegisterMsgHandlerServer

func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error

RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer 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 RegisterMsgHandlerFromEndpoint instead.

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 EventUpdateSudoers

type EventUpdateSudoers struct {
	Sudoers Sudoers `protobuf:"bytes,1,opt,name=sudoers,proto3" json:"sudoers"`
	// Action is the type of update that occured to the "sudoers"
	Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
}

func (*EventUpdateSudoers) Descriptor

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

func (*EventUpdateSudoers) GetAction

func (m *EventUpdateSudoers) GetAction() string

func (*EventUpdateSudoers) GetSudoers

func (m *EventUpdateSudoers) GetSudoers() Sudoers

func (*EventUpdateSudoers) Marshal

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

func (*EventUpdateSudoers) MarshalTo

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

func (*EventUpdateSudoers) MarshalToSizedBuffer

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

func (*EventUpdateSudoers) ProtoMessage

func (*EventUpdateSudoers) ProtoMessage()

func (*EventUpdateSudoers) Reset

func (m *EventUpdateSudoers) Reset()

func (*EventUpdateSudoers) Size

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

func (*EventUpdateSudoers) String

func (m *EventUpdateSudoers) String() string

func (*EventUpdateSudoers) Unmarshal

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

func (*EventUpdateSudoers) XXX_DiscardUnknown

func (m *EventUpdateSudoers) XXX_DiscardUnknown()

func (*EventUpdateSudoers) XXX_Marshal

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

func (*EventUpdateSudoers) XXX_Merge

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

func (*EventUpdateSudoers) XXX_Size

func (m *EventUpdateSudoers) XXX_Size() int

func (*EventUpdateSudoers) XXX_Unmarshal

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

type GenesisState

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

GenesisState defines the module's genesis state.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetSudoers

func (m *GenesisState) GetSudoers() Sudoers

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 (gen GenesisState) Validate() error

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 {
	// EditSudoers updates the "Sudoers" state
	EditSudoers(ctx context.Context, in *MsgEditSudoers, opts ...grpc.CallOption) (*MsgEditSudoersResponse, 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 MsgEditSudoers

type MsgEditSudoers struct {
	// Action: identifier for the type of edit that will take place. Using this
	//   action field prevents us from needing to create several similar message
	//   types.
	Action string `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"`
	// Contracts: An input payload.
	Contracts []string `protobuf:"bytes,2,rep,name=contracts,proto3" json:"contracts,omitempty"`
	// Sender: Address for the signer of the transaction.
	Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
}

MsgEditSudoers: Msg to update the "Sudoers" state.

func (*MsgEditSudoers) Descriptor

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

func (*MsgEditSudoers) GetAction

func (m *MsgEditSudoers) GetAction() string

func (*MsgEditSudoers) GetContracts

func (m *MsgEditSudoers) GetContracts() []string

func (*MsgEditSudoers) GetSender

func (m *MsgEditSudoers) GetSender() string

func (MsgEditSudoers) GetSignBytes

func (m MsgEditSudoers) GetSignBytes() []byte

func (MsgEditSudoers) GetSigners

func (m MsgEditSudoers) GetSigners() []sdk.AccAddress

func (*MsgEditSudoers) Marshal

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

func (*MsgEditSudoers) MarshalTo

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

func (*MsgEditSudoers) MarshalToSizedBuffer

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

func (*MsgEditSudoers) ProtoMessage

func (*MsgEditSudoers) ProtoMessage()

func (*MsgEditSudoers) Reset

func (m *MsgEditSudoers) Reset()

func (MsgEditSudoers) Route

func (m MsgEditSudoers) Route() string

func (*MsgEditSudoers) Size

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

func (*MsgEditSudoers) String

func (m *MsgEditSudoers) String() string

func (MsgEditSudoers) Type

func (m MsgEditSudoers) Type() string

func (*MsgEditSudoers) Unmarshal

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

func (MsgEditSudoers) ValidateBasic

func (m MsgEditSudoers) ValidateBasic() error

func (*MsgEditSudoers) XXX_DiscardUnknown

func (m *MsgEditSudoers) XXX_DiscardUnknown()

func (*MsgEditSudoers) XXX_Marshal

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

func (*MsgEditSudoers) XXX_Merge

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

func (*MsgEditSudoers) XXX_Size

func (m *MsgEditSudoers) XXX_Size() int

func (*MsgEditSudoers) XXX_Unmarshal

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

type MsgEditSudoersResponse

type MsgEditSudoersResponse struct {
}

MsgEditSudoersResponse indicates the successful execution of MsgEditSudeors.

func (*MsgEditSudoersResponse) Descriptor

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

func (*MsgEditSudoersResponse) Marshal

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

func (*MsgEditSudoersResponse) MarshalTo

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

func (*MsgEditSudoersResponse) MarshalToSizedBuffer

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

func (*MsgEditSudoersResponse) ProtoMessage

func (*MsgEditSudoersResponse) ProtoMessage()

func (*MsgEditSudoersResponse) Reset

func (m *MsgEditSudoersResponse) Reset()

func (*MsgEditSudoersResponse) Size

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

func (*MsgEditSudoersResponse) String

func (m *MsgEditSudoersResponse) String() string

func (*MsgEditSudoersResponse) Unmarshal

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

func (*MsgEditSudoersResponse) XXX_DiscardUnknown

func (m *MsgEditSudoersResponse) XXX_DiscardUnknown()

func (*MsgEditSudoersResponse) XXX_Marshal

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

func (*MsgEditSudoersResponse) XXX_Merge

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

func (*MsgEditSudoersResponse) XXX_Size

func (m *MsgEditSudoersResponse) XXX_Size() int

func (*MsgEditSudoersResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// EditSudoers updates the "Sudoers" state
	EditSudoers(context.Context, *MsgEditSudoers) (*MsgEditSudoersResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	QuerySudoers(ctx context.Context, in *QuerySudoersRequest, opts ...grpc.CallOption) (*QuerySudoersResponse, 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 QueryServer

type QueryServer interface {
	QuerySudoers(context.Context, *QuerySudoersRequest) (*QuerySudoersResponse, error)
}

QueryServer is the server API for Query service.

type QuerySudoersRequest

type QuerySudoersRequest struct {
}

func (*QuerySudoersRequest) Descriptor

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

func (*QuerySudoersRequest) Marshal

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

func (*QuerySudoersRequest) MarshalTo

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

func (*QuerySudoersRequest) MarshalToSizedBuffer

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

func (*QuerySudoersRequest) ProtoMessage

func (*QuerySudoersRequest) ProtoMessage()

func (*QuerySudoersRequest) Reset

func (m *QuerySudoersRequest) Reset()

func (*QuerySudoersRequest) Size

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

func (*QuerySudoersRequest) String

func (m *QuerySudoersRequest) String() string

func (*QuerySudoersRequest) Unmarshal

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

func (*QuerySudoersRequest) XXX_DiscardUnknown

func (m *QuerySudoersRequest) XXX_DiscardUnknown()

func (*QuerySudoersRequest) XXX_Marshal

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

func (*QuerySudoersRequest) XXX_Merge

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

func (*QuerySudoersRequest) XXX_Size

func (m *QuerySudoersRequest) XXX_Size() int

func (*QuerySudoersRequest) XXX_Unmarshal

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

type QuerySudoersResponse

type QuerySudoersResponse struct {
	Sudoers Sudoers `protobuf:"bytes,1,opt,name=sudoers,proto3" json:"sudoers"`
}

QuerySudoersResponse indicates the successful execution of MsgEditSudeors.

func (*QuerySudoersResponse) Descriptor

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

func (*QuerySudoersResponse) GetSudoers

func (m *QuerySudoersResponse) GetSudoers() Sudoers

func (*QuerySudoersResponse) Marshal

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

func (*QuerySudoersResponse) MarshalTo

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

func (*QuerySudoersResponse) MarshalToSizedBuffer

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

func (*QuerySudoersResponse) ProtoMessage

func (*QuerySudoersResponse) ProtoMessage()

func (*QuerySudoersResponse) Reset

func (m *QuerySudoersResponse) Reset()

func (*QuerySudoersResponse) Size

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

func (*QuerySudoersResponse) String

func (m *QuerySudoersResponse) String() string

func (*QuerySudoersResponse) Unmarshal

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

func (*QuerySudoersResponse) XXX_DiscardUnknown

func (m *QuerySudoersResponse) XXX_DiscardUnknown()

func (*QuerySudoersResponse) XXX_Marshal

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

func (*QuerySudoersResponse) XXX_Merge

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

func (*QuerySudoersResponse) XXX_Size

func (m *QuerySudoersResponse) XXX_Size() int

func (*QuerySudoersResponse) XXX_Unmarshal

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

type Sudoers

type Sudoers struct {
	// Root: The "root" user.
	Root string `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"`
	// Contracts: The set of contracts with elevated permissions.
	Contracts []string `protobuf:"bytes,2,rep,name=contracts,proto3" json:"contracts,omitempty"`
}

func (*Sudoers) Descriptor

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

func (*Sudoers) GetContracts

func (m *Sudoers) GetContracts() []string

func (*Sudoers) GetRoot

func (m *Sudoers) GetRoot() string

func (*Sudoers) Marshal

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

func (*Sudoers) MarshalTo

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

func (*Sudoers) MarshalToSizedBuffer

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

func (*Sudoers) ProtoMessage

func (*Sudoers) ProtoMessage()

func (*Sudoers) Reset

func (m *Sudoers) Reset()

func (*Sudoers) Size

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

func (Sudoers) String

func (sudo Sudoers) String() string

func (*Sudoers) Unmarshal

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

func (Sudoers) Validate

func (sudo Sudoers) Validate() error

func (*Sudoers) XXX_DiscardUnknown

func (m *Sudoers) XXX_DiscardUnknown()

func (*Sudoers) XXX_Marshal

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

func (*Sudoers) XXX_Merge

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

func (*Sudoers) XXX_Size

func (m *Sudoers) XXX_Size() int

func (*Sudoers) XXX_Unmarshal

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

type SudoersJson

type SudoersJson struct {
	Root      string   `json:"root"`
	Contracts []string `json:"contracts"`
}

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) EditSudoers

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) QuerySudoers

Jump to

Keyboard shortcuts

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