Documentation ¶
Overview ¶
Package didv1 provides the version 1.0 of the protocol buffers definitions for the project.
Index ¶
- Constants
- Variables
- func RegisterAgentAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAgentAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentAPIClient) error
- func RegisterAgentAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAgentAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentAPIServer) error
- func RegisterAgentAPIServer(s grpc.ServiceRegistrar, srv AgentAPIServer)
- type AgentAPIClient
- type AgentAPIServer
- type PingResponse
- func (*PingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PingResponse) GetOk() bool
- func (*PingResponse) ProtoMessage()
- func (x *PingResponse) ProtoReflect() protoreflect.Message
- func (x *PingResponse) Reset()
- func (x *PingResponse) String() string
- func (m *PingResponse) Validate() error
- func (m *PingResponse) ValidateAll() error
- type PingResponseMultiError
- type PingResponseValidationError
- func (e PingResponseValidationError) Cause() error
- func (e PingResponseValidationError) Error() string
- func (e PingResponseValidationError) ErrorName() string
- func (e PingResponseValidationError) Field() string
- func (e PingResponseValidationError) Key() bool
- func (e PingResponseValidationError) Reason() string
- type ProcessRequest
- func (*ProcessRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ProcessRequest) GetTask() ProcessRequest_Task
- func (x *ProcessRequest) GetTicket() *Ticket
- func (*ProcessRequest) ProtoMessage()
- func (x *ProcessRequest) ProtoReflect() protoreflect.Message
- func (x *ProcessRequest) Reset()
- func (x *ProcessRequest) String() string
- func (m *ProcessRequest) Validate() error
- func (m *ProcessRequest) ValidateAll() error
- type ProcessRequestMultiError
- type ProcessRequestValidationError
- func (e ProcessRequestValidationError) Cause() error
- func (e ProcessRequestValidationError) Error() string
- func (e ProcessRequestValidationError) ErrorName() string
- func (e ProcessRequestValidationError) Field() string
- func (e ProcessRequestValidationError) Key() bool
- func (e ProcessRequestValidationError) Reason() string
- type ProcessRequest_Task
- func (ProcessRequest_Task) Descriptor() protoreflect.EnumDescriptor
- func (x ProcessRequest_Task) Enum() *ProcessRequest_Task
- func (ProcessRequest_Task) EnumDescriptor() ([]byte, []int)deprecated
- func (x ProcessRequest_Task) Number() protoreflect.EnumNumber
- func (x ProcessRequest_Task) String() string
- func (ProcessRequest_Task) Type() protoreflect.EnumType
- type ProcessResponse
- func (*ProcessResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ProcessResponse) GetOk() bool
- func (*ProcessResponse) ProtoMessage()
- func (x *ProcessResponse) ProtoReflect() protoreflect.Message
- func (x *ProcessResponse) Reset()
- func (x *ProcessResponse) String() string
- func (m *ProcessResponse) Validate() error
- func (m *ProcessResponse) ValidateAll() error
- type ProcessResponseMultiError
- type ProcessResponseValidationError
- func (e ProcessResponseValidationError) Cause() error
- func (e ProcessResponseValidationError) Error() string
- func (e ProcessResponseValidationError) ErrorName() string
- func (e ProcessResponseValidationError) Field() string
- func (e ProcessResponseValidationError) Key() bool
- func (e ProcessResponseValidationError) Reason() string
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetMethod() string
- func (x *QueryRequest) GetSubject() string
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- func (m *QueryRequest) Validate() error
- func (m *QueryRequest) ValidateAll() error
- type QueryRequestMultiError
- type QueryRequestValidationError
- func (e QueryRequestValidationError) Cause() error
- func (e QueryRequestValidationError) Error() string
- func (e QueryRequestValidationError) ErrorName() string
- func (e QueryRequestValidationError) Field() string
- func (e QueryRequestValidationError) Key() bool
- func (e QueryRequestValidationError) Reason() string
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryResponse) GetDocument() []byte
- func (x *QueryResponse) GetProof() []byte
- func (*QueryResponse) ProtoMessage()
- func (x *QueryResponse) ProtoReflect() protoreflect.Message
- func (x *QueryResponse) Reset()
- func (x *QueryResponse) String() string
- func (m *QueryResponse) Validate() error
- func (m *QueryResponse) ValidateAll() error
- type QueryResponseMultiError
- type QueryResponseValidationError
- func (e QueryResponseValidationError) Cause() error
- func (e QueryResponseValidationError) Error() string
- func (e QueryResponseValidationError) ErrorName() string
- func (e QueryResponseValidationError) Field() string
- func (e QueryResponseValidationError) Key() bool
- func (e QueryResponseValidationError) Reason() string
- type Ticket
- func (*Ticket) Descriptor() ([]byte, []int)deprecated
- func (t *Ticket) GetDID() (*did.Identifier, error)
- func (x *Ticket) GetDocument() []byte
- func (x *Ticket) GetKeyId() string
- func (x *Ticket) GetNonceValue() int64
- func (x *Ticket) GetProof() []byte
- func (t *Ticket) GetProofLD() (*did.ProofLD, error)
- func (x *Ticket) GetSignature() []byte
- func (x *Ticket) GetTimestamp() int64
- func (t *Ticket) IncrementNonce()
- func (t *Ticket) MarshalBinary() ([]byte, error)
- func (t *Ticket) Nonce() int64
- func (*Ticket) ProtoMessage()
- func (x *Ticket) ProtoReflect() protoreflect.Message
- func (x *Ticket) Reset()
- func (t *Ticket) ResetNonce()
- func (t *Ticket) Solve(ctx context.Context, difficulty uint) string
- func (x *Ticket) String() string
- func (m *Ticket) Validate() error
- func (m *Ticket) ValidateAll() error
- func (t *Ticket) Verify(difficulty uint) error
- type TicketMultiError
- type TicketValidationError
- type UnimplementedAgentAPIServer
- type UnsafeAgentAPIServer
Constants ¶
const ( AgentAPI_Ping_FullMethodName = "/did.v1.AgentAPI/Ping" AgentAPI_Process_FullMethodName = "/did.v1.AgentAPI/Process" AgentAPI_Query_FullMethodName = "/did.v1.AgentAPI/Query" )
Variables ¶
var ( ProcessRequest_Task_name = map[int32]string{ 0: "TASK_UNSPECIFIED", 1: "TASK_PUBLISH", 2: "TASK_DEACTIVATE", } ProcessRequest_Task_value = map[string]int32{ "TASK_UNSPECIFIED": 0, "TASK_PUBLISH": 1, "TASK_DEACTIVATE": 2, } )
Enum value maps for ProcessRequest_Task.
var AgentAPI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "did.v1.AgentAPI", HandlerType: (*AgentAPIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _AgentAPI_Ping_Handler, }, { MethodName: "Process", Handler: _AgentAPI_Process_Handler, }, { MethodName: "Query", Handler: _AgentAPI_Query_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "did/v1/agent_api.proto", }
AgentAPI_ServiceDesc is the grpc.ServiceDesc for AgentAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_did_v1_agent_api_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAgentAPIHandler ¶
func RegisterAgentAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAgentAPIHandler registers the http handlers for service AgentAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAgentAPIHandlerClient ¶
func RegisterAgentAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentAPIClient) error
RegisterAgentAPIHandlerClient registers the http handlers for service AgentAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AgentAPIClient" to call the correct interceptors.
func RegisterAgentAPIHandlerFromEndpoint ¶
func RegisterAgentAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAgentAPIHandlerFromEndpoint is same as RegisterAgentAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAgentAPIHandlerServer ¶
func RegisterAgentAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentAPIServer) error
RegisterAgentAPIHandlerServer registers the http handlers for service AgentAPI to "mux". UnaryRPC :call AgentAPIServer 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 RegisterAgentAPIHandlerFromEndpoint instead.
func RegisterAgentAPIServer ¶
func RegisterAgentAPIServer(s grpc.ServiceRegistrar, srv AgentAPIServer)
Types ¶
type AgentAPIClient ¶
type AgentAPIClient interface { // Reachability test. Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PingResponse, error) // Process an incoming request ticket. Process(ctx context.Context, in *ProcessRequest, opts ...grpc.CallOption) (*ProcessResponse, error) // Return the current state of a DID subject. Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) }
AgentAPIClient is the client API for AgentAPI service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAgentAPIClient ¶
func NewAgentAPIClient(cc grpc.ClientConnInterface) AgentAPIClient
type AgentAPIServer ¶
type AgentAPIServer interface { // Reachability test. Ping(context.Context, *emptypb.Empty) (*PingResponse, error) // Process an incoming request ticket. Process(context.Context, *ProcessRequest) (*ProcessResponse, error) // Return the current state of a DID subject. Query(context.Context, *QueryRequest) (*QueryResponse, error) // contains filtered or unexported methods }
AgentAPIServer is the server API for AgentAPI service. All implementations must embed UnimplementedAgentAPIServer for forward compatibility
type PingResponse ¶
type PingResponse struct { // Responsiveness result. Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` // contains filtered or unexported fields }
Basic reachability test response.
func (*PingResponse) Descriptor
deprecated
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetOk ¶
func (x *PingResponse) GetOk() bool
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) ProtoReflect ¶
func (x *PingResponse) ProtoReflect() protoreflect.Message
func (*PingResponse) Reset ¶
func (x *PingResponse) Reset()
func (*PingResponse) String ¶
func (x *PingResponse) String() string
func (*PingResponse) Validate ¶
func (m *PingResponse) Validate() error
Validate checks the field values on PingResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*PingResponse) ValidateAll ¶ added in v0.9.0
func (m *PingResponse) ValidateAll() error
ValidateAll checks the field values on PingResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PingResponseMultiError, or nil if none found.
type PingResponseMultiError ¶ added in v0.9.0
type PingResponseMultiError []error
PingResponseMultiError is an error wrapping multiple validation errors returned by PingResponse.ValidateAll() if the designated constraints aren't met.
func (PingResponseMultiError) AllErrors ¶ added in v0.9.0
func (m PingResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PingResponseMultiError) Error ¶ added in v0.9.0
func (m PingResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PingResponseValidationError ¶
type PingResponseValidationError struct {
// contains filtered or unexported fields
}
PingResponseValidationError is the validation error returned by PingResponse.Validate if the designated constraints aren't met.
func (PingResponseValidationError) Cause ¶
func (e PingResponseValidationError) Cause() error
Cause function returns cause value.
func (PingResponseValidationError) Error ¶
func (e PingResponseValidationError) Error() string
Error satisfies the builtin error interface
func (PingResponseValidationError) ErrorName ¶
func (e PingResponseValidationError) ErrorName() string
ErrorName returns error name.
func (PingResponseValidationError) Field ¶
func (e PingResponseValidationError) Field() string
Field function returns field value.
func (PingResponseValidationError) Key ¶
func (e PingResponseValidationError) Key() bool
Key function returns key value.
func (PingResponseValidationError) Reason ¶
func (e PingResponseValidationError) Reason() string
Reason function returns reason value.
type ProcessRequest ¶
type ProcessRequest struct { // Mutation type. Task ProcessRequest_Task `protobuf:"varint,1,opt,name=task,proto3,enum=did.v1.ProcessRequest_Task" json:"task,omitempty"` // Request ticket. Ticket *Ticket `protobuf:"bytes,2,opt,name=ticket,proto3" json:"ticket,omitempty"` // contains filtered or unexported fields }
Mutation request, either to publish or deactivate a DID record.
func (*ProcessRequest) Descriptor
deprecated
func (*ProcessRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProcessRequest.ProtoReflect.Descriptor instead.
func (*ProcessRequest) GetTask ¶
func (x *ProcessRequest) GetTask() ProcessRequest_Task
func (*ProcessRequest) GetTicket ¶
func (x *ProcessRequest) GetTicket() *Ticket
func (*ProcessRequest) ProtoMessage ¶
func (*ProcessRequest) ProtoMessage()
func (*ProcessRequest) ProtoReflect ¶
func (x *ProcessRequest) ProtoReflect() protoreflect.Message
func (*ProcessRequest) Reset ¶
func (x *ProcessRequest) Reset()
func (*ProcessRequest) String ¶
func (x *ProcessRequest) String() string
func (*ProcessRequest) Validate ¶
func (m *ProcessRequest) Validate() error
Validate checks the field values on ProcessRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ProcessRequest) ValidateAll ¶ added in v0.9.0
func (m *ProcessRequest) ValidateAll() error
ValidateAll checks the field values on ProcessRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ProcessRequestMultiError, or nil if none found.
type ProcessRequestMultiError ¶ added in v0.9.0
type ProcessRequestMultiError []error
ProcessRequestMultiError is an error wrapping multiple validation errors returned by ProcessRequest.ValidateAll() if the designated constraints aren't met.
func (ProcessRequestMultiError) AllErrors ¶ added in v0.9.0
func (m ProcessRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ProcessRequestMultiError) Error ¶ added in v0.9.0
func (m ProcessRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ProcessRequestValidationError ¶
type ProcessRequestValidationError struct {
// contains filtered or unexported fields
}
ProcessRequestValidationError is the validation error returned by ProcessRequest.Validate if the designated constraints aren't met.
func (ProcessRequestValidationError) Cause ¶
func (e ProcessRequestValidationError) Cause() error
Cause function returns cause value.
func (ProcessRequestValidationError) Error ¶
func (e ProcessRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ProcessRequestValidationError) ErrorName ¶
func (e ProcessRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ProcessRequestValidationError) Field ¶
func (e ProcessRequestValidationError) Field() string
Field function returns field value.
func (ProcessRequestValidationError) Key ¶
func (e ProcessRequestValidationError) Key() bool
Key function returns key value.
func (ProcessRequestValidationError) Reason ¶
func (e ProcessRequestValidationError) Reason() string
Reason function returns reason value.
type ProcessRequest_Task ¶
type ProcessRequest_Task int32
Available mutations.
const ( ProcessRequest_TASK_UNSPECIFIED ProcessRequest_Task = 0 ProcessRequest_TASK_PUBLISH ProcessRequest_Task = 1 ProcessRequest_TASK_DEACTIVATE ProcessRequest_Task = 2 )
func (ProcessRequest_Task) Descriptor ¶
func (ProcessRequest_Task) Descriptor() protoreflect.EnumDescriptor
func (ProcessRequest_Task) Enum ¶
func (x ProcessRequest_Task) Enum() *ProcessRequest_Task
func (ProcessRequest_Task) EnumDescriptor
deprecated
func (ProcessRequest_Task) EnumDescriptor() ([]byte, []int)
Deprecated: Use ProcessRequest_Task.Descriptor instead.
func (ProcessRequest_Task) Number ¶
func (x ProcessRequest_Task) Number() protoreflect.EnumNumber
func (ProcessRequest_Task) String ¶
func (x ProcessRequest_Task) String() string
func (ProcessRequest_Task) Type ¶
func (ProcessRequest_Task) Type() protoreflect.EnumType
type ProcessResponse ¶
type ProcessResponse struct { // Processing result, must be 'true' if the mutation was // properly applied. Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` // contains filtered or unexported fields }
Mutation result.
func (*ProcessResponse) Descriptor
deprecated
func (*ProcessResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProcessResponse.ProtoReflect.Descriptor instead.
func (*ProcessResponse) GetOk ¶
func (x *ProcessResponse) GetOk() bool
func (*ProcessResponse) ProtoMessage ¶
func (*ProcessResponse) ProtoMessage()
func (*ProcessResponse) ProtoReflect ¶
func (x *ProcessResponse) ProtoReflect() protoreflect.Message
func (*ProcessResponse) Reset ¶
func (x *ProcessResponse) Reset()
func (*ProcessResponse) String ¶
func (x *ProcessResponse) String() string
func (*ProcessResponse) Validate ¶
func (m *ProcessResponse) Validate() error
Validate checks the field values on ProcessResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ProcessResponse) ValidateAll ¶ added in v0.9.0
func (m *ProcessResponse) ValidateAll() error
ValidateAll checks the field values on ProcessResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ProcessResponseMultiError, or nil if none found.
type ProcessResponseMultiError ¶ added in v0.9.0
type ProcessResponseMultiError []error
ProcessResponseMultiError is an error wrapping multiple validation errors returned by ProcessResponse.ValidateAll() if the designated constraints aren't met.
func (ProcessResponseMultiError) AllErrors ¶ added in v0.9.0
func (m ProcessResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ProcessResponseMultiError) Error ¶ added in v0.9.0
func (m ProcessResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ProcessResponseValidationError ¶
type ProcessResponseValidationError struct {
// contains filtered or unexported fields
}
ProcessResponseValidationError is the validation error returned by ProcessResponse.Validate if the designated constraints aren't met.
func (ProcessResponseValidationError) Cause ¶
func (e ProcessResponseValidationError) Cause() error
Cause function returns cause value.
func (ProcessResponseValidationError) Error ¶
func (e ProcessResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ProcessResponseValidationError) ErrorName ¶
func (e ProcessResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ProcessResponseValidationError) Field ¶
func (e ProcessResponseValidationError) Field() string
Field function returns field value.
func (ProcessResponseValidationError) Key ¶
func (e ProcessResponseValidationError) Key() bool
Key function returns key value.
func (ProcessResponseValidationError) Reason ¶
func (e ProcessResponseValidationError) Reason() string
Reason function returns reason value.
type QueryRequest ¶
type QueryRequest struct { // DID method. Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // DID subject. Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // contains filtered or unexported fields }
Queries allow to resolve a previously registered DID document.
func (*QueryRequest) Descriptor
deprecated
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetMethod ¶
func (x *QueryRequest) GetMethod() string
func (*QueryRequest) GetSubject ¶
func (x *QueryRequest) GetSubject() string
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶
func (x *QueryRequest) String() string
func (*QueryRequest) Validate ¶
func (m *QueryRequest) Validate() error
Validate checks the field values on QueryRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*QueryRequest) ValidateAll ¶ added in v0.9.0
func (m *QueryRequest) ValidateAll() error
ValidateAll checks the field values on QueryRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in QueryRequestMultiError, or nil if none found.
type QueryRequestMultiError ¶ added in v0.9.0
type QueryRequestMultiError []error
QueryRequestMultiError is an error wrapping multiple validation errors returned by QueryRequest.ValidateAll() if the designated constraints aren't met.
func (QueryRequestMultiError) AllErrors ¶ added in v0.9.0
func (m QueryRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (QueryRequestMultiError) Error ¶ added in v0.9.0
func (m QueryRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type QueryRequestValidationError ¶
type QueryRequestValidationError struct {
// contains filtered or unexported fields
}
QueryRequestValidationError is the validation error returned by QueryRequest.Validate if the designated constraints aren't met.
func (QueryRequestValidationError) Cause ¶
func (e QueryRequestValidationError) Cause() error
Cause function returns cause value.
func (QueryRequestValidationError) Error ¶
func (e QueryRequestValidationError) Error() string
Error satisfies the builtin error interface
func (QueryRequestValidationError) ErrorName ¶
func (e QueryRequestValidationError) ErrorName() string
ErrorName returns error name.
func (QueryRequestValidationError) Field ¶
func (e QueryRequestValidationError) Field() string
Field function returns field value.
func (QueryRequestValidationError) Key ¶
func (e QueryRequestValidationError) Key() bool
Key function returns key value.
func (QueryRequestValidationError) Reason ¶
func (e QueryRequestValidationError) Reason() string
Reason function returns reason value.
type QueryResponse ¶
type QueryResponse struct { // JSON-encoded DID document. Document []byte `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` // JSON-encoded DID proof. Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` // contains filtered or unexported fields }
Query response.
func (*QueryResponse) Descriptor
deprecated
func (*QueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) GetDocument ¶
func (x *QueryResponse) GetDocument() []byte
func (*QueryResponse) GetProof ¶
func (x *QueryResponse) GetProof() []byte
func (*QueryResponse) ProtoMessage ¶
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) ProtoReflect ¶
func (x *QueryResponse) ProtoReflect() protoreflect.Message
func (*QueryResponse) Reset ¶
func (x *QueryResponse) Reset()
func (*QueryResponse) String ¶
func (x *QueryResponse) String() string
func (*QueryResponse) Validate ¶
func (m *QueryResponse) Validate() error
Validate checks the field values on QueryResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*QueryResponse) ValidateAll ¶ added in v0.9.0
func (m *QueryResponse) ValidateAll() error
ValidateAll checks the field values on QueryResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in QueryResponseMultiError, or nil if none found.
type QueryResponseMultiError ¶ added in v0.9.0
type QueryResponseMultiError []error
QueryResponseMultiError is an error wrapping multiple validation errors returned by QueryResponse.ValidateAll() if the designated constraints aren't met.
func (QueryResponseMultiError) AllErrors ¶ added in v0.9.0
func (m QueryResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (QueryResponseMultiError) Error ¶ added in v0.9.0
func (m QueryResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type QueryResponseValidationError ¶
type QueryResponseValidationError struct {
// contains filtered or unexported fields
}
QueryResponseValidationError is the validation error returned by QueryResponse.Validate if the designated constraints aren't met.
func (QueryResponseValidationError) Cause ¶
func (e QueryResponseValidationError) Cause() error
Cause function returns cause value.
func (QueryResponseValidationError) Error ¶
func (e QueryResponseValidationError) Error() string
Error satisfies the builtin error interface
func (QueryResponseValidationError) ErrorName ¶
func (e QueryResponseValidationError) ErrorName() string
ErrorName returns error name.
func (QueryResponseValidationError) Field ¶
func (e QueryResponseValidationError) Field() string
Field function returns field value.
func (QueryResponseValidationError) Key ¶
func (e QueryResponseValidationError) Key() bool
Key function returns key value.
func (QueryResponseValidationError) Reason ¶
func (e QueryResponseValidationError) Reason() string
Reason function returns reason value.
type Ticket ¶
type Ticket struct { // UNIX timestamp (in UTC) when the ticket was generated. // All ticket automatically expire after 5 minutes to // prevent replay attacks. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Nonce selected to solve the PoW challenge. NonceValue int64 `protobuf:"varint,2,opt,name=nonce_value,json=nonceValue,proto3" json:"nonce_value,omitempty"` // Cryptographic key identifier. Must be a valid 'authentication' method // on the DID document. The key will be used to generate the DID proof // and to sign the ticket itself. KeyId string `protobuf:"bytes,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` // JSON encoded DID document. Document []byte `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"` // JSON encoded Proof document. Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` // Digital signature for the ticket, it's calculated using the // PoW solution as input. Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` // contains filtered or unexported fields }
Ticket required for write operations.
func NewTicket ¶
func NewTicket(id *did.Identifier, keyID string) (*Ticket, error)
NewTicket returns a properly initialized new ticket instance.
func (*Ticket) Descriptor
deprecated
func (*Ticket) GetDID ¶
func (t *Ticket) GetDID() (*did.Identifier, error)
GetDID retrieve the DID instance from the ticket contents.
func (*Ticket) GetDocument ¶
func (*Ticket) GetNonceValue ¶
func (*Ticket) GetProofLD ¶
GetProofLD returns the decoded proof document contained in the ticket.
func (*Ticket) GetSignature ¶
func (*Ticket) GetTimestamp ¶
func (*Ticket) IncrementNonce ¶
func (t *Ticket) IncrementNonce()
IncrementNonce will adjust the internal nonce value by 1.
func (*Ticket) MarshalBinary ¶
MarshalBinary returns a deterministic binary encoding for the ticket instance using a byte concatenation of the form: 'timestamp | nonce | key_id | document | proof' where timestamp and nonce are individually encoded using little endian byte order.
func (*Ticket) ProtoMessage ¶
func (*Ticket) ProtoMessage()
func (*Ticket) ProtoReflect ¶
func (x *Ticket) ProtoReflect() protoreflect.Message
func (*Ticket) ResetNonce ¶
func (t *Ticket) ResetNonce()
ResetNonce returns the internal nonce value back to 0.
func (*Ticket) Validate ¶
Validate checks the field values on Ticket with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Ticket) ValidateAll ¶ added in v0.9.0
ValidateAll checks the field values on Ticket with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TicketMultiError, or nil if none found.
func (*Ticket) Verify ¶
Verify perform all the required validations to ensure the request ticket is ready for further processing.
- Challenge is valid
- Contents are a properly encoded DID instance
- Contents don’t include any private key, for security reasons no private keys should ever be published on the network
- DID proof is valid
- Ticket signature is valid
type TicketMultiError ¶ added in v0.9.0
type TicketMultiError []error
TicketMultiError is an error wrapping multiple validation errors returned by Ticket.ValidateAll() if the designated constraints aren't met.
func (TicketMultiError) AllErrors ¶ added in v0.9.0
func (m TicketMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (TicketMultiError) Error ¶ added in v0.9.0
func (m TicketMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type TicketValidationError ¶
type TicketValidationError struct {
// contains filtered or unexported fields
}
TicketValidationError is the validation error returned by Ticket.Validate if the designated constraints aren't met.
func (TicketValidationError) Cause ¶
func (e TicketValidationError) Cause() error
Cause function returns cause value.
func (TicketValidationError) Error ¶
func (e TicketValidationError) Error() string
Error satisfies the builtin error interface
func (TicketValidationError) ErrorName ¶
func (e TicketValidationError) ErrorName() string
ErrorName returns error name.
func (TicketValidationError) Field ¶
func (e TicketValidationError) Field() string
Field function returns field value.
func (TicketValidationError) Key ¶
func (e TicketValidationError) Key() bool
Key function returns key value.
func (TicketValidationError) Reason ¶
func (e TicketValidationError) Reason() string
Reason function returns reason value.
type UnimplementedAgentAPIServer ¶
type UnimplementedAgentAPIServer struct { }
UnimplementedAgentAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedAgentAPIServer) Ping ¶
func (UnimplementedAgentAPIServer) Ping(context.Context, *emptypb.Empty) (*PingResponse, error)
func (UnimplementedAgentAPIServer) Process ¶
func (UnimplementedAgentAPIServer) Process(context.Context, *ProcessRequest) (*ProcessResponse, error)
func (UnimplementedAgentAPIServer) Query ¶
func (UnimplementedAgentAPIServer) Query(context.Context, *QueryRequest) (*QueryResponse, error)
type UnsafeAgentAPIServer ¶
type UnsafeAgentAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAgentAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AgentAPIServer will result in compilation errors.