operation

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// RegistrationStateFinished registration state finished
	RegistrationStateFinished = "finished"
	// RegistrationStateFailure registration state failure
	RegistrationStateFailure = "failure"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TLSConfig          *tls.Config
	BlocDomain         string
	Mode               string
	SidetreeReadToken  string
	SidetreeWriteToken string
}

Config defines configuration for trustbloc did method operations

type DIDDocument

type DIDDocument struct {
	PublicKey []*PublicKey `json:"publicKey,omitempty"`
	Service   []*Service   `json:"service,omitempty"`
}

DIDDocument did doc

type DIDState

type DIDState struct {
	Identifier string `json:"identifier,omitempty"`
	Reason     string `json:"reason,omitempty"`
	State      string `json:"state,omitempty"`
	Secret     Secret `json:"secret,omitempty"`
}

DIDState did state

type Handler

type Handler interface {
	Path() string
	Method() string
	Handle() http.HandlerFunc
}

Handler http handler for each controller API endpoint

type Key

type Key struct {
	PublicKeyBase58  string   `json:"publicKeyBase58,omitempty"`
	PrivateKeyBase58 string   `json:"privateKeyBase58,omitempty"`
	ID               string   `json:"id,omitempty"`
	Purpose          []string `json:"purpose,omitempty"`
}

Key include public key and private key

type Operation

type Operation struct {
	// contains filtered or unexported fields
}

Operation defines handlers

func New

func New(config *Config) *Operation

New returns did method operation instance

func (*Operation) GetRESTHandlers

func (o *Operation) GetRESTHandlers(mode string) ([]Handler, error)

GetRESTHandlers get all controller API handler available for this service

type PublicKey

type PublicKey struct {
	ID   string `json:"id,omitempty"`
	Type string `json:"type,omitempty"`
	// Value is always Base64
	Value    string   `json:"value,omitempty"`
	Usage    []string `json:"usage,omitempty"`
	Encoding string   `json:"encoding,omitempty"`
	Recovery bool     `json:"recovery,omitempty"`
	KeyType  string   `json:"keyType,omitempty"`
}

PublicKey public key

type RegisterDIDRequest

type RegisterDIDRequest struct {
	JobID       string            `json:"jobId,omitempty"`
	Options     map[string]string `json:"options,omitempty"`
	DIDDocument DIDDocument       `json:"didDocument,omitempty"`
}

RegisterDIDRequest input data for register DID

type RegisterResponse

type RegisterResponse struct {
	JobID             string                 `json:"jobId,omitempty"`
	DIDState          DIDState               `json:"didState,omitempty"`
	RegistrarMetadata map[string]interface{} `json:"registrarMetadata"`
	MethodMetadata    map[string]interface{} `json:"methodMetadata"`
}

RegisterResponse register response

type Secret

type Secret struct {
	Keys []Key `json:"keys,omitempty"`
}

Secret include keys

type Service

type Service struct {
	ID              string   `json:"id,omitempty"`
	Type            string   `json:"type,omitempty"`
	Priority        uint     `json:"priority,omitempty"`
	RecipientKeys   []string `json:"recipientKeys,omitempty"`
	RoutingKeys     []string `json:"routingKeys,omitempty"`
	ServiceEndpoint string   `json:"serviceEndpoint,omitempty"`
}

Service DID doc service

Jump to

Keyboard shortcuts

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