service

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: GPL-3.0 Imports: 27 Imported by: 1

README

x/service

Overview of the module.

Concepts

Describe specialized concepts and definitions used throughout the spec.

State

Specify and describe structures expected to marshalled into the store, and their keys

State Transitions

Standard state transition operations triggered by hooks, messages, etc.

Messages

Specify message structure(s) and expected state machine behaviour(s).

Begin Block

Specify any begin-block operations.

End Block

Specify any end-block operations.

Hooks

Describe available hooks to be called by/from this module.

Events

List and describe event tags used.

Client

List and describe CLI commands and gRPC and REST endpoints.

Params

List all module parameters, their types (in JSON) and services.

Future Improvements

Describe future improvements of this module.

Tests

Acceptance tests.

Appendix

Supplementary details referenced elsewhere within the spec.

Tech Stack

sonrhq/service is built on the following main stack:

Documentation

Overview

Package service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const ModuleName = "service"

Variables

View Source
var (
	ParamsKey  = collections.NewPrefix(0)
	CounterKey = collections.NewPrefix(1)
)
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 (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ErrDuplicateAddress error if there is a duplicate address
	ErrDuplicateAddress = errors.Register(ModuleName, 2, "duplicate address")
)

Functions

func RegisterInterfaces added in v0.8.10

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the interfaces types with the interface registry.

func RegisterMsgServer added in v0.8.10

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler added in v0.8.10

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 added in v0.8.10

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 added in v0.8.10

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 added in v0.8.10

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 added in v0.8.10

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type BankKeeper added in v0.8.10

type BankKeeper interface {
	SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type GenesisState added in v0.8.10

type GenesisState struct {
	// params defines all the parameters of the module.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

GenesisState is the state that must be provided at genesis.

func NewGenesisState added in v0.8.10

func NewGenesisState() *GenesisState

NewGenesisState creates a new genesis state with default values.

func (*GenesisState) Descriptor added in v0.8.10

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

func (*GenesisState) GetParams added in v0.8.10

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal added in v0.8.10

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

func (*GenesisState) MarshalTo added in v0.8.10

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

func (*GenesisState) MarshalToSizedBuffer added in v0.8.10

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

func (*GenesisState) ProtoMessage added in v0.8.10

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset added in v0.8.10

func (m *GenesisState) Reset()

func (*GenesisState) Size added in v0.8.10

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

func (*GenesisState) String added in v0.8.10

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal added in v0.8.10

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

func (*GenesisState) Validate added in v0.8.10

func (gs *GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any

func (*GenesisState) XXX_DiscardUnknown added in v0.8.10

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal added in v0.8.10

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

func (*GenesisState) XXX_Merge added in v0.8.10

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

func (*GenesisState) XXX_Size added in v0.8.10

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal added in v0.8.10

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

type GroupKeeper added in v0.8.10

type GroupKeeper interface {
	CreateGroupWithPolicy(goCtx context.Context, req *group.MsgCreateGroupWithPolicy) (*group.MsgCreateGroupWithPolicyResponse, error)
	GroupMembers(goCtx context.Context, request *group.QueryGroupMembersRequest) (*group.QueryGroupMembersResponse, error)
	GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error)
	GroupsByAdmin(goCtx context.Context, request *group.QueryGroupsByAdminRequest) (*group.QueryGroupsByAdminResponse, error)
	GroupsByMember(goCtx context.Context, request *group.QueryGroupsByMemberRequest) (*group.QueryGroupsByMemberResponse, error)
	LeaveGroup(goCtx context.Context, req *group.MsgLeaveGroup) (*group.MsgLeaveGroupResponse, error)
	Proposal(goCtx context.Context, request *group.QueryProposalRequest) (*group.QueryProposalResponse, error)
	SubmitProposal(goCtx context.Context, req *group.MsgSubmitProposal) (*group.MsgSubmitProposalResponse, error)
	UpdateGroupMembers(goCtx context.Context, req *group.MsgUpdateGroupMembers) (*group.MsgUpdateGroupMembersResponse, error)
	UpdateGroupMetadata(goCtx context.Context, req *group.MsgUpdateGroupMetadata) (*group.MsgUpdateGroupMetadataResponse, error)
	Vote(goCtx context.Context, req *group.MsgVote) (*group.MsgVoteResponse, error)
	VotesByProposal(goCtx context.Context, request *group.QueryVotesByProposalRequest) (*group.QueryVotesByProposalResponse, error)
	WithdrawProposal(goCtx context.Context, req *group.MsgWithdrawProposal) (*group.MsgWithdrawProposalResponse, error)
}

type IdentityKeeper added in v0.8.10

type IdentityKeeper interface {
	// LinkCredential links a credential to an identity.
	GenerateIdentity(ctx context.Context) error
	LinkCredential(ctx context.Context, identityID string) error
	LinkPersona(ctx context.Context, identityID string) error
	RevokeAccount(ctx context.Context, identityID string) error
	RevokeIdentity(ctx context.Context, identityID string) error
	SignWithAccount(ctx context.Context, identityID string) error
	UnlinkCredential(ctx context.Context, identityID string) error
	UnlinkPersona(ctx context.Context, identityID string) error
	VerifyAccountSignature(ctx context.Context, identityID string) error
}

IdentityKeeper is the expected interface for the identity keeper.

type MsgClient added in v0.8.10

type MsgClient interface {
	// UpdateParams updates the module parameters.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, 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 added in v0.8.10

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer added in v0.8.10

type MsgServer interface {
	// UpdateParams updates the module parameters.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParams added in v0.8.10

type MsgUpdateParams struct {
	// authority is the address that controls the module
	// NOTE: Defaults to the governance module unless overwritten.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the module parameters to update.
	// NOTE: All parameters must be supplied.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams is the Msg/UpdateParams request type.

func (*MsgUpdateParams) Descriptor added in v0.8.10

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

func (*MsgUpdateParams) GetAuthority added in v0.8.10

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams added in v0.8.10

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) Marshal added in v0.8.10

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

func (*MsgUpdateParams) MarshalTo added in v0.8.10

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

func (*MsgUpdateParams) MarshalToSizedBuffer added in v0.8.10

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

func (*MsgUpdateParams) ProtoMessage added in v0.8.10

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset added in v0.8.10

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size added in v0.8.10

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

func (*MsgUpdateParams) String added in v0.8.10

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal added in v0.8.10

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

func (*MsgUpdateParams) XXX_DiscardUnknown added in v0.8.10

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal added in v0.8.10

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

func (*MsgUpdateParams) XXX_Merge added in v0.8.10

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

func (*MsgUpdateParams) XXX_Size added in v0.8.10

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal added in v0.8.10

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

type MsgUpdateParamsResponse added in v0.8.10

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

func (*MsgUpdateParamsResponse) Descriptor added in v0.8.10

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

func (*MsgUpdateParamsResponse) Marshal added in v0.8.10

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

func (*MsgUpdateParamsResponse) MarshalTo added in v0.8.10

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

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer added in v0.8.10

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

func (*MsgUpdateParamsResponse) ProtoMessage added in v0.8.10

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset added in v0.8.10

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size added in v0.8.10

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

func (*MsgUpdateParamsResponse) String added in v0.8.10

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal added in v0.8.10

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

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown added in v0.8.10

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal added in v0.8.10

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

func (*MsgUpdateParamsResponse) XXX_Merge added in v0.8.10

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

func (*MsgUpdateParamsResponse) XXX_Size added in v0.8.10

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal added in v0.8.10

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

type Params added in v0.8.10

type Params struct {
}

Params defines the parameters of the module.

func DefaultParams added in v0.8.10

func DefaultParams() Params

DefaultParams returns default module parameters.

func (*Params) Descriptor added in v0.8.10

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

func (*Params) Marshal added in v0.8.10

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

func (*Params) MarshalTo added in v0.8.10

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

func (*Params) MarshalToSizedBuffer added in v0.8.10

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

func (*Params) ProtoMessage added in v0.8.10

func (*Params) ProtoMessage()

func (*Params) Reset added in v0.8.10

func (m *Params) Reset()

func (*Params) Size added in v0.8.10

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

func (*Params) String added in v0.8.10

func (m *Params) String() string

func (*Params) Unmarshal added in v0.8.10

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

func (Params) Validate added in v0.8.10

func (p Params) Validate() error

Validate does the sanity check on the params.

func (*Params) XXX_DiscardUnknown added in v0.8.10

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal added in v0.8.10

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

func (*Params) XXX_Merge added in v0.8.10

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

func (*Params) XXX_Size added in v0.8.10

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal added in v0.8.10

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

type QueryClient added in v0.8.10

type QueryClient interface {
	// Params returns the module parameters.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, 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 added in v0.8.10

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest added in v0.8.10

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor added in v0.8.10

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

func (*QueryParamsRequest) Marshal added in v0.8.10

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

func (*QueryParamsRequest) MarshalTo added in v0.8.10

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

func (*QueryParamsRequest) MarshalToSizedBuffer added in v0.8.10

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

func (*QueryParamsRequest) ProtoMessage added in v0.8.10

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset added in v0.8.10

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size added in v0.8.10

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

func (*QueryParamsRequest) String added in v0.8.10

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal added in v0.8.10

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

func (*QueryParamsRequest) XXX_DiscardUnknown added in v0.8.10

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal added in v0.8.10

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

func (*QueryParamsRequest) XXX_Merge added in v0.8.10

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

func (*QueryParamsRequest) XXX_Size added in v0.8.10

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal added in v0.8.10

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

type QueryParamsResponse added in v0.8.10

type QueryParamsResponse struct {
	// params defines the parameters of the module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor added in v0.8.10

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

func (*QueryParamsResponse) GetParams added in v0.8.10

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal added in v0.8.10

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

func (*QueryParamsResponse) MarshalTo added in v0.8.10

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

func (*QueryParamsResponse) MarshalToSizedBuffer added in v0.8.10

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

func (*QueryParamsResponse) ProtoMessage added in v0.8.10

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset added in v0.8.10

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size added in v0.8.10

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

func (*QueryParamsResponse) String added in v0.8.10

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal added in v0.8.10

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

func (*QueryParamsResponse) XXX_DiscardUnknown added in v0.8.10

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal added in v0.8.10

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

func (*QueryParamsResponse) XXX_Merge added in v0.8.10

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

func (*QueryParamsResponse) XXX_Size added in v0.8.10

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal added in v0.8.10

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

type QueryServer added in v0.8.10

type QueryServer interface {
	// Params returns the module parameters.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer added in v0.8.10

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdateParams added in v0.8.10

type UnimplementedQueryServer added in v0.8.10

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params added in v0.8.10

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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