types

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 33 Imported by: 3

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	DefaultCreateResourceImageFee   = 10e9                   // 10 CHEQ or 10000000000 ncheq
	DefaultCreateResourceJSONFee    = 25e8                   // 2.5 CHEQ or 2500000000 ncheq
	DefaultCreateResourceDefaultFee = 5e9                    // 5 CHEQ or 5000000000 ncheq
	DefaultBurnFactor               = "0.500000000000000000" // 0.5 or 50%
)
View Source
const (
	// ModuleName defines the module name
	ModuleName = "resource"

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

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName
)
View Source
const (
	ResourceMetadataKey = "resource-metadata:"
	ResourceDataKey     = "resource-data:"
	ResourceCountKey    = "resource-count:"
)
View Source
const (
	QueryGetResource            = "get-resource"
	QueryGetResourceMetadata    = "get-resource-metadata"
	QueryGetCollectionResources = "get-collection-resources"
)
View Source
const (
	BaseMinimalDenom = "ncheq"
)

Variables

View Source
var (
	ErrBadRequest      = sdkerrors.Register(ModuleName, 2000, "bad request")
	ErrResourceExists  = sdkerrors.Register(ModuleName, 2200, "Resource exists")
	ErrBasicValidation = sdkerrors.Register(ModuleName, 2205, "basic validation failed")
	ErrInternal        = sdkerrors.Register(ModuleName, 2500, "internal error")
)

x/resource module sentinel errors

View Source
var (
	ErrInvalidLengthFee        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFee          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFee = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ErrInvalidLengthResource        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowResource          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupResource = 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 (
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var ParamStoreKeyFeeParams = []byte("feeparams")

Functions

func GetResourceDataKey added in v0.8.0

func GetResourceDataKey(collectionID string, id string) []byte

GetResourceDataKey returns the byte representation of resource key

func GetResourceMetadataCollectionPrefix added in v0.8.0

func GetResourceMetadataCollectionPrefix(collectionID string) []byte

GetResourceMetadataCollectionPrefix used to iterate over all resource metadatas in a collection

func GetResourceMetadataKey added in v0.8.0

func GetResourceMetadataKey(collectionID string, id string) []byte

GetResourceMetadataKey returns the byte representation of resource key

func ParamKeyTable added in v0.8.0

func ParamKeyTable() paramstypes.KeyTable

ParamKeyTable returns the key declaration for parameters

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)

func ValidAlternativeURI added in v1.1.0

func ValidAlternativeURI() *didtypes.CustomErrorRule

func ValidMsgCreateResourcePayload

func ValidMsgCreateResourcePayload() *didtypes.CustomErrorRule

Types

type AlternativeUri added in v0.8.0

type AlternativeUri struct {
	// uri is the URI of the Resource.
	// Examples:
	// - did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e
	// - https://resolver..cheqd.net/1.0/identifiers/did:cheqd:testnet:MjYxNzYKMjYxNzYK/resources/4600ea35-8916-4ac4-b412-55b8f49dd94e
	// - https://example.com/example.json
	// - https://gateway.ipfs.io/ipfs/bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe
	// - ipfs://bafybeihetj2ng3d74k7t754atv2s5dk76pcqtvxls6dntef3xa6rax25xe
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
	// description is a human-readable description of the URI. Defined client-side.
	// Examples:
	// - did-uri
	// - http-uri
	// - ipfs-uri
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}

AlternativeUri are alternative URIs that can be used to access the Resource. By default, at least the DID URI equivalent of the Resource is populated.

func (*AlternativeUri) Descriptor added in v0.8.0

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

func (*AlternativeUri) GetDescription added in v0.8.0

func (m *AlternativeUri) GetDescription() string

func (*AlternativeUri) GetUri added in v0.8.0

func (m *AlternativeUri) GetUri() string

func (*AlternativeUri) Marshal added in v0.8.0

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

func (*AlternativeUri) MarshalTo added in v0.8.0

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

func (*AlternativeUri) MarshalToSizedBuffer added in v0.8.0

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

func (*AlternativeUri) ProtoMessage added in v0.8.0

func (*AlternativeUri) ProtoMessage()

func (*AlternativeUri) Reset added in v0.8.0

func (m *AlternativeUri) Reset()

func (*AlternativeUri) Size added in v0.8.0

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

func (*AlternativeUri) String added in v0.8.0

func (m *AlternativeUri) String() string

func (*AlternativeUri) Unmarshal added in v0.8.0

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

func (AlternativeUri) Validate added in v0.8.0

func (au AlternativeUri) Validate() error

validation

func (*AlternativeUri) XXX_DiscardUnknown added in v0.8.0

func (m *AlternativeUri) XXX_DiscardUnknown()

func (*AlternativeUri) XXX_Marshal added in v0.8.0

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

func (*AlternativeUri) XXX_Merge added in v0.8.0

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

func (*AlternativeUri) XXX_Size added in v0.8.0

func (m *AlternativeUri) XXX_Size() int

func (*AlternativeUri) XXX_Unmarshal added in v0.8.0

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

type FeeParams added in v0.8.0

type FeeParams struct {
	// Fixed fee for creating a resource with media type 'image/*'
	//
	// Default: 10 CHEQ or 10000000000ncheq
	Image types.Coin `protobuf:"bytes,1,opt,name=image,proto3" json:"image"`
	// Fixed fee for creating a resource with media type 'application/json'
	//
	// Default: 2.5 CHEQ or 2500000000ncheq
	Json types.Coin `protobuf:"bytes,2,opt,name=json,proto3" json:"json"`
	// Fixed fee for creating a resource with all other media types
	//
	// Default: 5 CHEQ or 5000000000ncheq
	Default types.Coin `protobuf:"bytes,3,opt,name=default,proto3" json:"default"`
	// Percentage of the fixed fee that will be burned
	//
	// Default: 0.5 (50%)
	BurnFactor github_com_cosmos_cosmos_sdk_types.Dec `` /* 131-byte string literal not displayed */
}

FeeParams defines the parameters for the cheqd Resource module fixed fee. Creation requests for different IANA media types are charged different fees.

func DefaultFeeParams added in v0.8.0

func DefaultFeeParams() *FeeParams

DefaultFeeParams returns default cheqd module tx fee parameters

func (*FeeParams) Descriptor added in v0.8.0

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

func (*FeeParams) Equal added in v0.8.0

func (this *FeeParams) Equal(that interface{}) bool

func (*FeeParams) GetDefault added in v0.8.0

func (m *FeeParams) GetDefault() types.Coin

func (*FeeParams) GetImage added in v0.8.0

func (m *FeeParams) GetImage() types.Coin

func (*FeeParams) GetJson added in v0.8.0

func (m *FeeParams) GetJson() types.Coin

func (*FeeParams) Marshal added in v0.8.0

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

func (*FeeParams) MarshalTo added in v0.8.0

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

func (*FeeParams) MarshalToSizedBuffer added in v0.8.0

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

func (*FeeParams) ProtoMessage added in v0.8.0

func (*FeeParams) ProtoMessage()

func (*FeeParams) Reset added in v0.8.0

func (m *FeeParams) Reset()

func (*FeeParams) Size added in v0.8.0

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

func (*FeeParams) String added in v0.8.0

func (m *FeeParams) String() string

func (*FeeParams) Unmarshal added in v0.8.0

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

func (*FeeParams) ValidateBasic added in v0.8.0

func (tfp *FeeParams) ValidateBasic() error

ValidateBasic performs basic validation of cheqd module tx fee parameters

func (*FeeParams) XXX_DiscardUnknown added in v0.8.0

func (m *FeeParams) XXX_DiscardUnknown()

func (*FeeParams) XXX_Marshal added in v0.8.0

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

func (*FeeParams) XXX_Merge added in v0.8.0

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

func (*FeeParams) XXX_Size added in v0.8.0

func (m *FeeParams) XXX_Size() int

func (*FeeParams) XXX_Unmarshal added in v0.8.0

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

type GenesisState

type GenesisState struct {
	// All Resources with metadata
	Resources []*ResourceWithMetadata `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"`
	// Fee parameters for the Resource module
	// Defines fixed fees and burn percentage for resources
	FeeParams *FeeParams `protobuf:"bytes,2,opt,name=fee_params,json=feeParams,proto3" json:"fee_params,omitempty"`
}

GenesisState defines the chqed Resource module's genesis state

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default `resource` genesis state

func (*GenesisState) Descriptor

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

func (*GenesisState) GetFeeParams added in v0.8.0

func (m *GenesisState) GetFeeParams() *FeeParams

func (*GenesisState) GetResources added in v0.8.0

func (m *GenesisState) GetResources() []*ResourceWithMetadata

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) ValidateNoDuplicates added in v0.8.0

func (gs GenesisState) ValidateNoDuplicates() 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 Metadata added in v0.8.0

type Metadata struct {
	// collection_id is the ID of the collection that the Resource belongs to. Defined client-side.
	// This field is the unique identifier of the DID linked to this Resource
	// Format: <unique-identifier>
	//
	// Examples:
	// - c82f2b02-bdab-4dd7-b833-3e143745d612
	// - wGHEXrZvJxR8vw5P3UWH1j
	CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"resourceCollectionId"`
	// id is the ID of the Resource. Defined client-side.
	// This field is a unique identifier for this specific version of the Resource.
	// Format: <uuid>
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"resourceId"`
	// name is a human-readable name for the Resource. Defined client-side.
	// Does not change between different versions.
	// Example: PassportSchema, EducationTrustRegistry
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"resourceName"`
	// version is a human-readable semantic version for the Resource. Defined client-side.
	// Stored as a string. OPTIONAL.
	// Example: 1.0.0, v2.1.0
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"resourceVersion"`
	// resource_type is a Resource type that identifies what the Resource is. Defined client-side.
	// This is NOT the same as the resource's media type.
	// Example: AnonCredsSchema, StatusList2021
	ResourceType string `protobuf:"bytes,5,opt,name=resource_type,json=resourceType,proto3" json:"resourceType"`
	// List of alternative URIs for the SAME Resource.
	AlsoKnownAs []*AlternativeUri `protobuf:"bytes,6,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"resourceAlternativeUri"`
	// media_type is IANA media type of the Resource. Defined ledger-side.
	// Example: application/json, image/png
	MediaType string `protobuf:"bytes,7,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
	// created is the time at which the Resource was created. Defined ledger-side.
	// Format: RFC3339
	// Example: 2021-01-01T00:00:00Z
	Created time.Time `protobuf:"bytes,8,opt,name=created,proto3,stdtime" json:"created"`
	// checksum is a SHA-256 checksum hash of the Resource. Defined ledger-side.
	// Example: d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
	Checksum string `protobuf:"bytes,9,opt,name=checksum,proto3" json:"checksum,omitempty"`
	// previous_version_id is the ID of the previous version of the Resource. Defined ledger-side.
	// This is based on the Resource's name and Resource type to determine whether it's the same Resource.
	// Format: <uuid>
	PreviousVersionId string `protobuf:"bytes,10,opt,name=previous_version_id,json=previousVersionId,proto3" json:"previous_version_id,omitempty"`
	// next_version_id is the ID of the next version of the Resource. Defined ledger-side.
	// This is based on the Resource's name and Resource type to determine whether it's the same Resource.
	// Format: <uuid>
	NextVersionId string `protobuf:"bytes,11,opt,name=next_version_id,json=nextVersionId,proto3" json:"next_version_id,omitempty"`
}

Metadata stores the metadata of a DID-Linked Resource

func (*Metadata) Descriptor added in v0.8.0

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

func (*Metadata) GetAlsoKnownAs added in v0.8.0

func (m *Metadata) GetAlsoKnownAs() []*AlternativeUri

func (*Metadata) GetChecksum added in v0.8.0

func (m *Metadata) GetChecksum() string

func (*Metadata) GetCollectionId added in v0.8.0

func (m *Metadata) GetCollectionId() string

func (*Metadata) GetCreated added in v0.8.0

func (m *Metadata) GetCreated() time.Time

func (*Metadata) GetId added in v0.8.0

func (m *Metadata) GetId() string

func (*Metadata) GetMediaType added in v0.8.0

func (m *Metadata) GetMediaType() string

func (*Metadata) GetName added in v0.8.0

func (m *Metadata) GetName() string

func (*Metadata) GetNextVersionId added in v0.8.0

func (m *Metadata) GetNextVersionId() string

func (*Metadata) GetPreviousVersionId added in v0.8.0

func (m *Metadata) GetPreviousVersionId() string

func (*Metadata) GetResourceType added in v0.8.0

func (m *Metadata) GetResourceType() string

func (*Metadata) GetVersion added in v0.8.0

func (m *Metadata) GetVersion() string

func (*Metadata) Marshal added in v0.8.0

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

func (*Metadata) MarshalTo added in v0.8.0

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

func (*Metadata) MarshalToSizedBuffer added in v0.8.0

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

func (*Metadata) ProtoMessage added in v0.8.0

func (*Metadata) ProtoMessage()

func (*Metadata) Reset added in v0.8.0

func (m *Metadata) Reset()

func (*Metadata) Size added in v0.8.0

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

func (*Metadata) String added in v0.8.0

func (m *Metadata) String() string

func (*Metadata) Unmarshal added in v0.8.0

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

func (*Metadata) XXX_DiscardUnknown added in v0.8.0

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal added in v0.8.0

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

func (*Metadata) XXX_Merge added in v0.8.0

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

func (*Metadata) XXX_Size added in v0.8.0

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal added in v0.8.0

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

type MsgClient

type MsgClient interface {
	// CreateResource defines a method for creating a resource.
	CreateResource(ctx context.Context, in *MsgCreateResource, opts ...grpc.CallOption) (*MsgCreateResourceResponse, 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 MsgCreateResource

type MsgCreateResource struct {
	// Payload containing the resource to be created.
	Payload *MsgCreateResourcePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// Signatures of the corresponding DID Document's controller(s).
	Signatures []*types.SignInfo `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
}

MsgCreateResource defines the Msg/CreateResource request type. It describes the parameters of a request for creating a resource.

func NewMsgCreateResource

func NewMsgCreateResource(payload *MsgCreateResourcePayload, signatures []*didtypes.SignInfo) *MsgCreateResource

func (*MsgCreateResource) Descriptor

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

func (*MsgCreateResource) GetPayload

func (*MsgCreateResource) GetSignBytes

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

func (*MsgCreateResource) GetSignatures

func (m *MsgCreateResource) GetSignatures() []*types.SignInfo

func (*MsgCreateResource) GetSigners

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

func (*MsgCreateResource) Marshal

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

func (*MsgCreateResource) MarshalTo

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

func (*MsgCreateResource) MarshalToSizedBuffer

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

func (*MsgCreateResource) Normalize added in v0.8.0

func (msg *MsgCreateResource) Normalize()

func (*MsgCreateResource) ProtoMessage

func (*MsgCreateResource) ProtoMessage()

func (*MsgCreateResource) Reset

func (m *MsgCreateResource) Reset()

func (*MsgCreateResource) Route

func (msg *MsgCreateResource) Route() string

func (*MsgCreateResource) Size

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

func (*MsgCreateResource) String

func (m *MsgCreateResource) String() string

func (*MsgCreateResource) Type

func (msg *MsgCreateResource) Type() string

func (*MsgCreateResource) Unmarshal

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

func (MsgCreateResource) Validate

func (msg MsgCreateResource) Validate(allowedNamespaces []string) error

func (*MsgCreateResource) ValidateBasic

func (msg *MsgCreateResource) ValidateBasic() error

func (*MsgCreateResource) XXX_DiscardUnknown

func (m *MsgCreateResource) XXX_DiscardUnknown()

func (*MsgCreateResource) XXX_Marshal

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

func (*MsgCreateResource) XXX_Merge

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

func (*MsgCreateResource) XXX_Size

func (m *MsgCreateResource) XXX_Size() int

func (*MsgCreateResource) XXX_Unmarshal

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

type MsgCreateResourcePayload

type MsgCreateResourcePayload struct {
	// data is a byte-representation of the actual Data the user wants to store.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// collection_id is an identifier of the DidDocument the resource belongs to.
	// Format: <unique-identifier>
	//
	// Examples:
	// - c82f2b02-bdab-4dd7-b833-3e143745d612
	// - wGHEXrZvJxR8vw5P3UWH1j
	CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"resourceCollectionId"`
	// id is a unique id of the resource.
	// Format: <uuid>
	Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"resourceId"`
	// name is a human-readable name of the resource.
	// Format: <string>
	//
	// Does not change between different versions.
	// Example: PassportSchema, EducationTrustRegistry
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"resourceName"`
	// version is a version of the resource.
	// Format: <string>
	// Stored as a string. OPTIONAL.
	//
	// Example: 1.0.0, v2.1.0
	Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"resourceVersion"`
	// resource_type is a type of the resource.
	// Format: <string>
	//
	// This is NOT the same as the resource's media type.
	// Example: AnonCredsSchema, StatusList2021
	ResourceType string `protobuf:"bytes,6,opt,name=resource_type,json=resourceType,proto3" json:"resourceType"`
	// also_known_as is a list of URIs that can be used to get the resource.
	AlsoKnownAs []*AlternativeUri `protobuf:"bytes,7,rep,name=also_known_as,json=alsoKnownAs,proto3" json:"resourceAlternativeUri"`
}

MsgCreateResourcePayload defines the structure of the payload for creating a resource.

If a resource with the given id does not exist already, it will be created. The resource will be created in the resource collection.

If a resource with the given id, collection_id already exists, an error code 2200 will be returned.

A new version of the resource in an existing collection will be created, if a resource in that collection with the same name, resource_type and empty next_version_id exists.

An update operation is not possible, because the resource is immutable by design.

func (*MsgCreateResourcePayload) Descriptor

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

func (*MsgCreateResourcePayload) GetAlsoKnownAs added in v0.8.0

func (m *MsgCreateResourcePayload) GetAlsoKnownAs() []*AlternativeUri

func (*MsgCreateResourcePayload) GetCollectionId

func (m *MsgCreateResourcePayload) GetCollectionId() string

func (*MsgCreateResourcePayload) GetData

func (m *MsgCreateResourcePayload) GetData() []byte

func (*MsgCreateResourcePayload) GetId

func (m *MsgCreateResourcePayload) GetId() string

func (*MsgCreateResourcePayload) GetName

func (m *MsgCreateResourcePayload) GetName() string

func (*MsgCreateResourcePayload) GetResourceType

func (m *MsgCreateResourcePayload) GetResourceType() string

func (*MsgCreateResourcePayload) GetSignBytes

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

func (*MsgCreateResourcePayload) GetVersion added in v0.8.0

func (m *MsgCreateResourcePayload) GetVersion() string

func (*MsgCreateResourcePayload) Marshal

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

func (*MsgCreateResourcePayload) MarshalTo

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

func (*MsgCreateResourcePayload) MarshalToSizedBuffer

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

func (*MsgCreateResourcePayload) Normalize added in v0.8.0

func (msg *MsgCreateResourcePayload) Normalize()

func (*MsgCreateResourcePayload) ProtoMessage

func (*MsgCreateResourcePayload) ProtoMessage()

func (*MsgCreateResourcePayload) Reset

func (m *MsgCreateResourcePayload) Reset()

func (*MsgCreateResourcePayload) Size

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

func (*MsgCreateResourcePayload) String

func (m *MsgCreateResourcePayload) String() string

func (*MsgCreateResourcePayload) ToResource

func (*MsgCreateResourcePayload) Unmarshal

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

func (MsgCreateResourcePayload) Validate

func (msg MsgCreateResourcePayload) Validate() error

func (*MsgCreateResourcePayload) XXX_DiscardUnknown

func (m *MsgCreateResourcePayload) XXX_DiscardUnknown()

func (*MsgCreateResourcePayload) XXX_Marshal

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

func (*MsgCreateResourcePayload) XXX_Merge

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

func (*MsgCreateResourcePayload) XXX_Size

func (m *MsgCreateResourcePayload) XXX_Size() int

func (*MsgCreateResourcePayload) XXX_Unmarshal

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

type MsgCreateResourceResponse

type MsgCreateResourceResponse struct {
	// Return the created resource metadata.
	Resource *Metadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"linkedResourceMetadata"`
}

func (*MsgCreateResourceResponse) Descriptor

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

func (*MsgCreateResourceResponse) GetResource

func (m *MsgCreateResourceResponse) GetResource() *Metadata

func (*MsgCreateResourceResponse) Marshal

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

func (*MsgCreateResourceResponse) MarshalTo

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

func (*MsgCreateResourceResponse) MarshalToSizedBuffer

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

func (*MsgCreateResourceResponse) ProtoMessage

func (*MsgCreateResourceResponse) ProtoMessage()

func (*MsgCreateResourceResponse) Reset

func (m *MsgCreateResourceResponse) Reset()

func (*MsgCreateResourceResponse) Size

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

func (*MsgCreateResourceResponse) String

func (m *MsgCreateResourceResponse) String() string

func (*MsgCreateResourceResponse) Unmarshal

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

func (*MsgCreateResourceResponse) XXX_DiscardUnknown

func (m *MsgCreateResourceResponse) XXX_DiscardUnknown()

func (*MsgCreateResourceResponse) XXX_Marshal

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

func (*MsgCreateResourceResponse) XXX_Merge

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

func (*MsgCreateResourceResponse) XXX_Size

func (m *MsgCreateResourceResponse) XXX_Size() int

func (*MsgCreateResourceResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// CreateResource defines a method for creating a resource.
	CreateResource(context.Context, *MsgCreateResource) (*MsgCreateResourceResponse, error)
}

MsgServer is the server API for Msg service.

type ParamSubspace added in v0.8.0

type ParamSubspace interface {
	Get(ctx sdk.Context, key []byte, ptr interface{})
	Set(ctx sdk.Context, key []byte, param interface{})
}

ParamSubspace defines the expected Subspace interface for parameters (noalias)

type QueryClient

type QueryClient interface {
	// Fetch data/payload for a specific resource (without metadata)
	Resource(ctx context.Context, in *QueryResourceRequest, opts ...grpc.CallOption) (*QueryResourceResponse, error)
	// Fetch only metadata for a specific resource
	ResourceMetadata(ctx context.Context, in *QueryResourceMetadataRequest, opts ...grpc.CallOption) (*QueryResourceMetadataResponse, error)
	// Fetch metadata for all resources in a collection
	CollectionResources(ctx context.Context, in *QueryCollectionResourcesRequest, opts ...grpc.CallOption) (*QueryCollectionResourcesResponse, 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 QueryCollectionResourcesRequest added in v1.1.0

type QueryCollectionResourcesRequest struct {
	// collection_id is an identifier of the DidDocument the resource belongs to.
	// Format: <unique-identifier>
	//
	// Examples:
	// - c82f2b02-bdab-4dd7-b833-3e143745d612
	// - wGHEXrZvJxR8vw5P3UWH1j
	CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryCollectionResourcesRequest is the request type for the Query/CollectionResources RPC method

func (*QueryCollectionResourcesRequest) Descriptor added in v1.1.0

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

func (*QueryCollectionResourcesRequest) GetCollectionId added in v1.1.0

func (m *QueryCollectionResourcesRequest) GetCollectionId() string

func (*QueryCollectionResourcesRequest) GetPagination added in v1.2.0

func (*QueryCollectionResourcesRequest) Marshal added in v1.1.0

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

func (*QueryCollectionResourcesRequest) MarshalTo added in v1.1.0

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

func (*QueryCollectionResourcesRequest) MarshalToSizedBuffer added in v1.1.0

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

func (*QueryCollectionResourcesRequest) Normalize added in v1.1.0

func (query *QueryCollectionResourcesRequest) Normalize()

func (*QueryCollectionResourcesRequest) ProtoMessage added in v1.1.0

func (*QueryCollectionResourcesRequest) ProtoMessage()

func (*QueryCollectionResourcesRequest) Reset added in v1.1.0

func (*QueryCollectionResourcesRequest) Size added in v1.1.0

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

func (*QueryCollectionResourcesRequest) String added in v1.1.0

func (*QueryCollectionResourcesRequest) Unmarshal added in v1.1.0

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

func (*QueryCollectionResourcesRequest) XXX_DiscardUnknown added in v1.1.0

func (m *QueryCollectionResourcesRequest) XXX_DiscardUnknown()

func (*QueryCollectionResourcesRequest) XXX_Marshal added in v1.1.0

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

func (*QueryCollectionResourcesRequest) XXX_Merge added in v1.1.0

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

func (*QueryCollectionResourcesRequest) XXX_Size added in v1.1.0

func (m *QueryCollectionResourcesRequest) XXX_Size() int

func (*QueryCollectionResourcesRequest) XXX_Unmarshal added in v1.1.0

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

type QueryCollectionResourcesResponse added in v1.1.0

type QueryCollectionResourcesResponse struct {
	// resources is the requested collection of resource metadata
	Resources []*Metadata `protobuf:"bytes,1,rep,name=resources,proto3" json:"linkedResourceMetadata"`
	// pagination defines the pagination in the response.
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryCollectionResourcesResponse is the response type for the Query/CollectionResources RPC method

func (*QueryCollectionResourcesResponse) Descriptor added in v1.1.0

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

func (*QueryCollectionResourcesResponse) GetPagination added in v1.2.0

func (*QueryCollectionResourcesResponse) GetResources added in v1.1.0

func (m *QueryCollectionResourcesResponse) GetResources() []*Metadata

func (*QueryCollectionResourcesResponse) Marshal added in v1.1.0

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

func (*QueryCollectionResourcesResponse) MarshalTo added in v1.1.0

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

func (*QueryCollectionResourcesResponse) MarshalToSizedBuffer added in v1.1.0

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

func (*QueryCollectionResourcesResponse) ProtoMessage added in v1.1.0

func (*QueryCollectionResourcesResponse) ProtoMessage()

func (*QueryCollectionResourcesResponse) Reset added in v1.1.0

func (*QueryCollectionResourcesResponse) Size added in v1.1.0

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

func (*QueryCollectionResourcesResponse) String added in v1.1.0

func (*QueryCollectionResourcesResponse) Unmarshal added in v1.1.0

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

func (*QueryCollectionResourcesResponse) XXX_DiscardUnknown added in v1.1.0

func (m *QueryCollectionResourcesResponse) XXX_DiscardUnknown()

func (*QueryCollectionResourcesResponse) XXX_Marshal added in v1.1.0

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

func (*QueryCollectionResourcesResponse) XXX_Merge added in v1.1.0

func (*QueryCollectionResourcesResponse) XXX_Size added in v1.1.0

func (m *QueryCollectionResourcesResponse) XXX_Size() int

func (*QueryCollectionResourcesResponse) XXX_Unmarshal added in v1.1.0

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

type QueryResourceMetadataRequest added in v1.1.0

type QueryResourceMetadataRequest struct {
	// collection_id is an identifier of the DidDocument the resource belongs to.
	// Format: <unique-identifier>
	//
	// Examples:
	// - c82f2b02-bdab-4dd7-b833-3e143745d612
	// - wGHEXrZvJxR8vw5P3UWH1j
	CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"`
	// id is a unique id of the resource.
	// Format: <uuid>
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}

QueryResourceMetadataRequest is the request type for the Query/ResourceMetadata RPC method

func (*QueryResourceMetadataRequest) Descriptor added in v1.1.0

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

func (*QueryResourceMetadataRequest) GetCollectionId added in v1.1.0

func (m *QueryResourceMetadataRequest) GetCollectionId() string

func (*QueryResourceMetadataRequest) GetId added in v1.1.0

func (*QueryResourceMetadataRequest) Marshal added in v1.1.0

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

func (*QueryResourceMetadataRequest) MarshalTo added in v1.1.0

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

func (*QueryResourceMetadataRequest) MarshalToSizedBuffer added in v1.1.0

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

func (*QueryResourceMetadataRequest) Normalize added in v1.1.0

func (query *QueryResourceMetadataRequest) Normalize()

func (*QueryResourceMetadataRequest) ProtoMessage added in v1.1.0

func (*QueryResourceMetadataRequest) ProtoMessage()

func (*QueryResourceMetadataRequest) Reset added in v1.1.0

func (m *QueryResourceMetadataRequest) Reset()

func (*QueryResourceMetadataRequest) Size added in v1.1.0

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

func (*QueryResourceMetadataRequest) String added in v1.1.0

func (*QueryResourceMetadataRequest) Unmarshal added in v1.1.0

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

func (*QueryResourceMetadataRequest) XXX_DiscardUnknown added in v1.1.0

func (m *QueryResourceMetadataRequest) XXX_DiscardUnknown()

func (*QueryResourceMetadataRequest) XXX_Marshal added in v1.1.0

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

func (*QueryResourceMetadataRequest) XXX_Merge added in v1.1.0

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

func (*QueryResourceMetadataRequest) XXX_Size added in v1.1.0

func (m *QueryResourceMetadataRequest) XXX_Size() int

func (*QueryResourceMetadataRequest) XXX_Unmarshal added in v1.1.0

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

type QueryResourceMetadataResponse added in v1.1.0

type QueryResourceMetadataResponse struct {
	// resource is the requested resource metadata
	Resource *Metadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"linkedResourceMetadata"`
}

QueryResourceMetadataResponse is the response type for the Query/ResourceMetadata RPC method

func (*QueryResourceMetadataResponse) Descriptor added in v1.1.0

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

func (*QueryResourceMetadataResponse) GetResource added in v1.1.0

func (m *QueryResourceMetadataResponse) GetResource() *Metadata

func (*QueryResourceMetadataResponse) Marshal added in v1.1.0

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

func (*QueryResourceMetadataResponse) MarshalTo added in v1.1.0

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

func (*QueryResourceMetadataResponse) MarshalToSizedBuffer added in v1.1.0

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

func (*QueryResourceMetadataResponse) ProtoMessage added in v1.1.0

func (*QueryResourceMetadataResponse) ProtoMessage()

func (*QueryResourceMetadataResponse) Reset added in v1.1.0

func (m *QueryResourceMetadataResponse) Reset()

func (*QueryResourceMetadataResponse) Size added in v1.1.0

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

func (*QueryResourceMetadataResponse) String added in v1.1.0

func (*QueryResourceMetadataResponse) Unmarshal added in v1.1.0

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

func (*QueryResourceMetadataResponse) XXX_DiscardUnknown added in v1.1.0

func (m *QueryResourceMetadataResponse) XXX_DiscardUnknown()

func (*QueryResourceMetadataResponse) XXX_Marshal added in v1.1.0

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

func (*QueryResourceMetadataResponse) XXX_Merge added in v1.1.0

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

func (*QueryResourceMetadataResponse) XXX_Size added in v1.1.0

func (m *QueryResourceMetadataResponse) XXX_Size() int

func (*QueryResourceMetadataResponse) XXX_Unmarshal added in v1.1.0

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

type QueryResourceRequest added in v1.1.0

type QueryResourceRequest struct {
	// collection_id is an identifier of the DidDocument the resource belongs to.
	// Format: <unique-identifier>
	//
	// Examples:
	// - c82f2b02-bdab-4dd7-b833-3e143745d612
	// - wGHEXrZvJxR8vw5P3UWH1j
	CollectionId string `protobuf:"bytes,1,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"`
	// id is a unique id of the resource.
	// Format: <uuid>
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
}

QueryResourceRequest is the request type for the Query/Resource RPC method

func (*QueryResourceRequest) Descriptor added in v1.1.0

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

func (*QueryResourceRequest) GetCollectionId added in v1.1.0

func (m *QueryResourceRequest) GetCollectionId() string

func (*QueryResourceRequest) GetId added in v1.1.0

func (m *QueryResourceRequest) GetId() string

func (*QueryResourceRequest) Marshal added in v1.1.0

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

func (*QueryResourceRequest) MarshalTo added in v1.1.0

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

func (*QueryResourceRequest) MarshalToSizedBuffer added in v1.1.0

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

func (*QueryResourceRequest) Normalize added in v1.1.0

func (query *QueryResourceRequest) Normalize()

func (*QueryResourceRequest) ProtoMessage added in v1.1.0

func (*QueryResourceRequest) ProtoMessage()

func (*QueryResourceRequest) Reset added in v1.1.0

func (m *QueryResourceRequest) Reset()

func (*QueryResourceRequest) Size added in v1.1.0

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

func (*QueryResourceRequest) String added in v1.1.0

func (m *QueryResourceRequest) String() string

func (*QueryResourceRequest) Unmarshal added in v1.1.0

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

func (*QueryResourceRequest) XXX_DiscardUnknown added in v1.1.0

func (m *QueryResourceRequest) XXX_DiscardUnknown()

func (*QueryResourceRequest) XXX_Marshal added in v1.1.0

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

func (*QueryResourceRequest) XXX_Merge added in v1.1.0

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

func (*QueryResourceRequest) XXX_Size added in v1.1.0

func (m *QueryResourceRequest) XXX_Size() int

func (*QueryResourceRequest) XXX_Unmarshal added in v1.1.0

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

type QueryResourceResponse added in v1.1.0

type QueryResourceResponse struct {
	// Successful resolution of the resource returns the following:
	// - resource is the requested resource
	// - metadata is the resource metadata associated with the requested resource
	Resource *ResourceWithMetadata `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
}

QueryResourceResponse is the response type for the Query/Resource RPC method

func (*QueryResourceResponse) Descriptor added in v1.1.0

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

func (*QueryResourceResponse) GetResource added in v1.1.0

func (m *QueryResourceResponse) GetResource() *ResourceWithMetadata

func (*QueryResourceResponse) Marshal added in v1.1.0

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

func (*QueryResourceResponse) MarshalTo added in v1.1.0

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

func (*QueryResourceResponse) MarshalToSizedBuffer added in v1.1.0

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

func (*QueryResourceResponse) ProtoMessage added in v1.1.0

func (*QueryResourceResponse) ProtoMessage()

func (*QueryResourceResponse) Reset added in v1.1.0

func (m *QueryResourceResponse) Reset()

func (*QueryResourceResponse) Size added in v1.1.0

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

func (*QueryResourceResponse) String added in v1.1.0

func (m *QueryResourceResponse) String() string

func (*QueryResourceResponse) Unmarshal added in v1.1.0

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

func (*QueryResourceResponse) XXX_DiscardUnknown added in v1.1.0

func (m *QueryResourceResponse) XXX_DiscardUnknown()

func (*QueryResourceResponse) XXX_Marshal added in v1.1.0

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

func (*QueryResourceResponse) XXX_Merge added in v1.1.0

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

func (*QueryResourceResponse) XXX_Size added in v1.1.0

func (m *QueryResourceResponse) XXX_Size() int

func (*QueryResourceResponse) XXX_Unmarshal added in v1.1.0

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

type QueryServer

type QueryServer interface {
	// Fetch data/payload for a specific resource (without metadata)
	Resource(context.Context, *QueryResourceRequest) (*QueryResourceResponse, error)
	// Fetch only metadata for a specific resource
	ResourceMetadata(context.Context, *QueryResourceMetadataRequest) (*QueryResourceMetadataResponse, error)
	// Fetch metadata for all resources in a collection
	CollectionResources(context.Context, *QueryCollectionResourcesRequest) (*QueryCollectionResourcesResponse, error)
}

QueryServer is the server API for Query service.

type Resource

type Resource struct {
	// bytes is the raw data of the Resource
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

Resource stores the contents of a DID-Linked Resource

func (*Resource) Descriptor

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

func (*Resource) GetData

func (m *Resource) GetData() []byte

func (*Resource) Marshal

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

func (*Resource) MarshalTo

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

func (*Resource) MarshalToSizedBuffer

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

func (*Resource) ProtoMessage

func (*Resource) ProtoMessage()

func (*Resource) Reset

func (m *Resource) Reset()

func (*Resource) Size

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

func (*Resource) String

func (m *Resource) String() string

func (*Resource) Unmarshal

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

func (*Resource) XXX_DiscardUnknown

func (m *Resource) XXX_DiscardUnknown()

func (*Resource) XXX_Marshal

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

func (*Resource) XXX_Merge

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

func (*Resource) XXX_Size

func (m *Resource) XXX_Size() int

func (*Resource) XXX_Unmarshal

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

type ResourceWithMetadata added in v0.8.0

type ResourceWithMetadata struct {
	Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"linkedResource"`
	Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"linkedResourceMetadata"`
}

ResourceWithMetadata describes the overall structure of a DID-Linked Resource

func (*ResourceWithMetadata) Descriptor added in v0.8.0

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

func (*ResourceWithMetadata) GetMetadata added in v0.8.0

func (m *ResourceWithMetadata) GetMetadata() *Metadata

func (*ResourceWithMetadata) GetResource added in v0.8.0

func (m *ResourceWithMetadata) GetResource() *Resource

func (*ResourceWithMetadata) Marshal added in v0.8.0

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

func (*ResourceWithMetadata) MarshalTo added in v0.8.0

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

func (*ResourceWithMetadata) MarshalToSizedBuffer added in v0.8.0

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

func (*ResourceWithMetadata) ProtoMessage added in v0.8.0

func (*ResourceWithMetadata) ProtoMessage()

func (*ResourceWithMetadata) Reset added in v0.8.0

func (m *ResourceWithMetadata) Reset()

func (*ResourceWithMetadata) Size added in v0.8.0

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

func (*ResourceWithMetadata) String added in v0.8.0

func (m *ResourceWithMetadata) String() string

func (*ResourceWithMetadata) Unmarshal added in v0.8.0

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

func (*ResourceWithMetadata) XXX_DiscardUnknown added in v0.8.0

func (m *ResourceWithMetadata) XXX_DiscardUnknown()

func (*ResourceWithMetadata) XXX_Marshal added in v0.8.0

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

func (*ResourceWithMetadata) XXX_Merge added in v0.8.0

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

func (*ResourceWithMetadata) XXX_Size added in v0.8.0

func (m *ResourceWithMetadata) XXX_Size() int

func (*ResourceWithMetadata) XXX_Unmarshal added in v0.8.0

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreateResource

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) CollectionResources

func (*UnimplementedQueryServer) Resource

func (*UnimplementedQueryServer) ResourceMetadata added in v0.8.0

Directories

Path Synopsis
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.

Jump to

Keyboard shortcuts

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