types

package
v0.0.0-...-e057505 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDid        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDid          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDid = 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")
)

Functions

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 DidDocument

type DidDocument struct {
	// @context is spec for did document.
	Context []string `protobuf:"bytes,1,rep,name=context,proto3" json:"@context,omitempty"`
	// id represents the id for the did document.
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// A DID controller is an entity that is authorized to make changes to a DID document.
	// cfr. https://www.w3.org/TR/did-core/#did-controller
	Controller []string `protobuf:"bytes,3,rep,name=controller,proto3" json:"controller,omitempty"`
	// A DID document can express verification methods,
	// such as cryptographic public keys, which can be used
	// to authenticate or authorize interactions with the DID subject or associated parties.
	// https://www.w3.org/TR/did-core/#verification-methods
	VerificationMethod []*VerificationMethod `protobuf:"bytes,4,rep,name=verificationMethod,proto3" json:"verificationMethod,omitempty"`
	// Services are used in DID documents to express ways of communicating
	// with the DID subject or associated entities.
	// https://www.w3.org/TR/did-core/#services
	Service []*Service `protobuf:"bytes,5,rep,name=service,proto3" json:"service,omitempty"`
	// Authentication represents public key associated with the did document.
	// cfr. https://www.w3.org/TR/did-core/#authentication
	Authentication []string `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"`
	// Used to specify how the DID subject is expected to express claims,
	// such as for the purposes of issuing a Verifiable Credential.
	// cfr. https://www.w3.org/TR/did-core/#assertion
	AssertionMethod []string `protobuf:"bytes,7,rep,name=assertionMethod,proto3" json:"assertionMethod,omitempty"`
	// used to specify how an entity can generate encryption material
	// in order to transmit confidential information intended for the DID subject.
	// https://www.w3.org/TR/did-core/#key-agreement
	KeyAgreement []string `protobuf:"bytes,8,rep,name=keyAgreement,proto3" json:"keyAgreement,omitempty"`
	// Used to specify a verification method that might be used by the DID subject
	// to invoke a cryptographic capability, such as the authorization
	// to update the DID Document.
	// https://www.w3.org/TR/did-core/#capability-invocation
	CapabilityInvocation []string `protobuf:"bytes,9,rep,name=capabilityInvocation,proto3" json:"capabilityInvocation,omitempty"`
	// Used to specify a mechanism that might be used by the DID subject
	// to delegate a cryptographic capability to another party.
	// https://www.w3.org/TR/did-core/#capability-delegation
	CapabilityDelegation []string `protobuf:"bytes,10,rep,name=capabilityDelegation,proto3" json:"capabilityDelegation,omitempty"`
}

DidDocument represents a dencentralised identifer.

func (*DidDocument) Descriptor

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

func (*DidDocument) Equal

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

func (*DidDocument) Marshal

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

func (*DidDocument) MarshalTo

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

func (*DidDocument) MarshalToSizedBuffer

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

func (*DidDocument) ProtoMessage

func (*DidDocument) ProtoMessage()

func (*DidDocument) Reset

func (m *DidDocument) Reset()

func (*DidDocument) Size

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

func (*DidDocument) String

func (m *DidDocument) String() string

func (*DidDocument) Unmarshal

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

func (*DidDocument) XXX_DiscardUnknown

func (m *DidDocument) XXX_DiscardUnknown()

func (*DidDocument) XXX_Marshal

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

func (*DidDocument) XXX_Merge

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

func (*DidDocument) XXX_Size

func (m *DidDocument) XXX_Size() int

func (*DidDocument) XXX_Unmarshal

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

type DidMetadata

type DidMetadata struct {
	VersionId   string     `protobuf:"bytes,1,opt,name=versionId,proto3" json:"versionId,omitempty"`
	Created     *time.Time `protobuf:"bytes,2,opt,name=created,proto3,stdtime" json:"created,omitempty"`
	Updated     *time.Time `protobuf:"bytes,3,opt,name=updated,proto3,stdtime" json:"updated,omitempty"`
	Deactivated bool       `protobuf:"varint,4,opt,name=deactivated,proto3" json:"deactivated,omitempty"`
}

DidMetadata defines metadata associated to a did document such as the status of the DID document

func (*DidMetadata) Descriptor

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

func (*DidMetadata) Equal

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

func (*DidMetadata) Marshal

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

func (*DidMetadata) MarshalTo

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

func (*DidMetadata) MarshalToSizedBuffer

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

func (*DidMetadata) ProtoMessage

func (*DidMetadata) ProtoMessage()

func (*DidMetadata) Reset

func (m *DidMetadata) Reset()

func (*DidMetadata) Size

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

func (*DidMetadata) String

func (m *DidMetadata) String() string

func (*DidMetadata) Unmarshal

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

func (*DidMetadata) XXX_DiscardUnknown

func (m *DidMetadata) XXX_DiscardUnknown()

func (*DidMetadata) XXX_Marshal

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

func (*DidMetadata) XXX_Merge

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

func (*DidMetadata) XXX_Size

func (m *DidMetadata) XXX_Size() int

func (*DidMetadata) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// DidDocument queries a did documents with an id.
	DidDocument(ctx context.Context, in *QueryDidDocumentRequest, opts ...grpc.CallOption) (*QueryDidDocumentResponse, 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 QueryDidDocumentRequest

type QueryDidDocumentRequest struct {
	// status enables to query for validators matching a given status.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}

QueryDidDocumentsRequest is request type for Query/DidDocuments RPC method.

func (*QueryDidDocumentRequest) Descriptor

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

func (*QueryDidDocumentRequest) GetId

func (m *QueryDidDocumentRequest) GetId() string

func (*QueryDidDocumentRequest) Marshal

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

func (*QueryDidDocumentRequest) MarshalTo

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

func (*QueryDidDocumentRequest) MarshalToSizedBuffer

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

func (*QueryDidDocumentRequest) ProtoMessage

func (*QueryDidDocumentRequest) ProtoMessage()

func (*QueryDidDocumentRequest) Reset

func (m *QueryDidDocumentRequest) Reset()

func (*QueryDidDocumentRequest) Size

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

func (*QueryDidDocumentRequest) String

func (m *QueryDidDocumentRequest) String() string

func (*QueryDidDocumentRequest) Unmarshal

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

func (*QueryDidDocumentRequest) XXX_DiscardUnknown

func (m *QueryDidDocumentRequest) XXX_DiscardUnknown()

func (*QueryDidDocumentRequest) XXX_Marshal

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

func (*QueryDidDocumentRequest) XXX_Merge

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

func (*QueryDidDocumentRequest) XXX_Size

func (m *QueryDidDocumentRequest) XXX_Size() int

func (*QueryDidDocumentRequest) XXX_Unmarshal

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

type QueryDidDocumentResponse

type QueryDidDocumentResponse struct {
	// validators contains all the queried validators.
	DidDocument DidDocument `protobuf:"bytes,1,opt,name=didDocument,proto3" json:"didDocument"`
	DidMetadata DidMetadata `protobuf:"bytes,2,opt,name=didMetadata,proto3" json:"didMetadata"`
}

QueryDidDocumentsResponse is response type for the Query/DidDocuments RPC method

func (*QueryDidDocumentResponse) Descriptor

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

func (*QueryDidDocumentResponse) GetDidDocument

func (m *QueryDidDocumentResponse) GetDidDocument() DidDocument

func (*QueryDidDocumentResponse) GetDidMetadata

func (m *QueryDidDocumentResponse) GetDidMetadata() DidMetadata

func (*QueryDidDocumentResponse) Marshal

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

func (*QueryDidDocumentResponse) MarshalTo

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

func (*QueryDidDocumentResponse) MarshalToSizedBuffer

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

func (*QueryDidDocumentResponse) ProtoMessage

func (*QueryDidDocumentResponse) ProtoMessage()

func (*QueryDidDocumentResponse) Reset

func (m *QueryDidDocumentResponse) Reset()

func (*QueryDidDocumentResponse) Size

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

func (*QueryDidDocumentResponse) String

func (m *QueryDidDocumentResponse) String() string

func (*QueryDidDocumentResponse) Unmarshal

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

func (*QueryDidDocumentResponse) XXX_DiscardUnknown

func (m *QueryDidDocumentResponse) XXX_DiscardUnknown()

func (*QueryDidDocumentResponse) XXX_Marshal

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

func (*QueryDidDocumentResponse) XXX_Merge

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

func (*QueryDidDocumentResponse) XXX_Size

func (m *QueryDidDocumentResponse) XXX_Size() int

func (*QueryDidDocumentResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// DidDocument queries a did documents with an id.
	DidDocument(context.Context, *QueryDidDocumentRequest) (*QueryDidDocumentResponse, error)
}

QueryServer is the server API for Query service.

type Service

type Service struct {
	Id              string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type            string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	ServiceEndpoint string `protobuf:"bytes,3,opt,name=serviceEndpoint,proto3" json:"serviceEndpoint,omitempty"`
}

Service defines how to find data associated with a identifer

func (*Service) Descriptor

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

func (*Service) Equal

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

func (*Service) Marshal

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

func (*Service) MarshalTo

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

func (*Service) MarshalToSizedBuffer

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

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) Size

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

func (*Service) String

func (m *Service) String() string

func (*Service) Unmarshal

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

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

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

func (*Service) XXX_Merge

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

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

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

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) DidDocument

type VerificationMethod

type VerificationMethod struct {
	Id         string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type       string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Controller string `protobuf:"bytes,3,opt,name=controller,proto3" json:"controller,omitempty"`
	// Types that are valid to be assigned to VerificationMaterial:
	//	*VerificationMethod_BlockchainAccountID
	//	*VerificationMethod_PublicKeyHex
	//	*VerificationMethod_PublicKeyMyltibase
	VerificationMaterial isVerificationMethod_VerificationMaterial `protobuf_oneof:"verificationMaterial"`
}

A DID document can express verification methods, such as cryptographic public keys, which can be used to authenticate or authorize interactions with the DID subject or associated parties. https://www.w3.org/TR/did-core/#verification-methods

func (*VerificationMethod) Descriptor

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

func (*VerificationMethod) Equal

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

func (*VerificationMethod) GetBlockchainAccountID

func (m *VerificationMethod) GetBlockchainAccountID() string

func (*VerificationMethod) GetPublicKeyHex

func (m *VerificationMethod) GetPublicKeyHex() string

func (*VerificationMethod) GetPublicKeyMyltibase

func (m *VerificationMethod) GetPublicKeyMyltibase() string

func (*VerificationMethod) GetVerificationMaterial

func (m *VerificationMethod) GetVerificationMaterial() isVerificationMethod_VerificationMaterial

func (*VerificationMethod) Marshal

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

func (VerificationMethod) MarshalJSON

func (vm VerificationMethod) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom marshaller for rendergin verification material

func (*VerificationMethod) MarshalTo

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

func (*VerificationMethod) MarshalToSizedBuffer

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

func (*VerificationMethod) ProtoMessage

func (*VerificationMethod) ProtoMessage()

func (*VerificationMethod) Reset

func (m *VerificationMethod) Reset()

func (*VerificationMethod) Size

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

func (*VerificationMethod) String

func (m *VerificationMethod) String() string

func (*VerificationMethod) Unmarshal

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

func (*VerificationMethod) XXX_DiscardUnknown

func (m *VerificationMethod) XXX_DiscardUnknown()

func (*VerificationMethod) XXX_Marshal

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

func (*VerificationMethod) XXX_Merge

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

func (*VerificationMethod) XXX_OneofWrappers

func (*VerificationMethod) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*VerificationMethod) XXX_Size

func (m *VerificationMethod) XXX_Size() int

func (*VerificationMethod) XXX_Unmarshal

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

type VerificationMethod_BlockchainAccountID

type VerificationMethod_BlockchainAccountID struct {
	BlockchainAccountID string `protobuf:"bytes,4,opt,name=blockchainAccountID,proto3,oneof" json:"blockchainAccountID,omitempty"`
}

func (*VerificationMethod_BlockchainAccountID) Equal

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

func (*VerificationMethod_BlockchainAccountID) MarshalTo

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

func (*VerificationMethod_BlockchainAccountID) MarshalToSizedBuffer

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

func (*VerificationMethod_BlockchainAccountID) Size

type VerificationMethod_PublicKeyHex

type VerificationMethod_PublicKeyHex struct {
	PublicKeyHex string `protobuf:"bytes,5,opt,name=publicKeyHex,proto3,oneof" json:"publicKeyHex,omitempty"`
}

func (*VerificationMethod_PublicKeyHex) Equal

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

func (*VerificationMethod_PublicKeyHex) MarshalTo

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

func (*VerificationMethod_PublicKeyHex) MarshalToSizedBuffer

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

func (*VerificationMethod_PublicKeyHex) Size

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

type VerificationMethod_PublicKeyMyltibase

type VerificationMethod_PublicKeyMyltibase struct {
	PublicKeyMyltibase string `protobuf:"bytes,6,opt,name=publicKeyMyltibase,proto3,oneof" json:"publicKeyMyltibase,omitempty"`
}

func (*VerificationMethod_PublicKeyMyltibase) Equal

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

func (*VerificationMethod_PublicKeyMyltibase) MarshalTo

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

func (*VerificationMethod_PublicKeyMyltibase) MarshalToSizedBuffer

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

func (*VerificationMethod_PublicKeyMyltibase) Size

Jump to

Keyboard shortcuts

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