api

package
v0.0.0-...-fa7ad1f Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLongForm

func ParseLongForm(uri string) (SuffixData, Delta, error)

Types

type API

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

func New

func New(opts ...Options) (*API, error)

func (*API) Submit

func (a *API) Submit(i interface{}) ([]byte, error)

type Create

type Create struct {
	Operation
	SuffixData SuffixData `json:"suffixData"`
	Delta      Delta      `json:"delta"`
}

func CreateOperation

func CreateOperation(suffixData SuffixData, delta Delta) Create

func (Create) EncodedSuffixData

func (c Create) EncodedSuffixData() (string, error)

func (Create) LongFormURI

func (c Create) LongFormURI(method string) (string, error)

func (Create) ShortFormURI

func (c Create) ShortFormURI(method string) (string, error)

type Deactivate

type Deactivate struct {
	Operation
	UpdateOp
}

func DeactivateOperation

func DeactivateOperation(suffix, reveal, signature string) Deactivate

type Delta

type Delta struct {
	Patches          []map[string]interface{} `json:"patches"`
	UpdateCommitment string                   `json:"updateCommitment"`
}

type Operation

type Operation struct {
	Type string `json:"type"`
}

type Options

type Options func(a *API) error

func WithChallenge

func WithChallenge(endpoint string) Options

func WithEndpoint

func WithEndpoint(endpoint string) Options

type Recover

type Recover Update

func RecoverOperation

func RecoverOperation(suffix, reveal, signature string, delta Delta) Recover

type SuffixData

type SuffixData struct {
	Type               string `json:"type,omitempty"`
	DeltaHash          string `json:"deltaHash"`
	RecoveryCommitment string `json:"recoveryCommitment"`
	AnchorOrigin       string `json:"anchorOrigin,omitempty"`
}

func (SuffixData) URI

func (s SuffixData) URI() (string, error)

type Update

type Update struct {
	Operation
	UpdateOp
	Delta Delta `json:"delta"`
}

func UpdateOperation

func UpdateOperation(suffix, reveal, signature string, delta Delta) Update

type UpdateOp

type UpdateOp struct {
	DIDSuffix   string `json:"didSuffix"`
	RevealValue string `json:"revealValue"`
	SignedData  string `json:"signedData"`
}

Jump to

Keyboard shortcuts

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