client

package
v0.0.0-...-4ff583b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEADER_CONTENT_TYPE_KEY              = "Content-Type"
	HEADER_CONTENT_TYPE_APPLICATION_JSON = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DWNClient

type DWNClient struct {
	DWNUrlBase      string
	Protocol        string
	ProtocolVersion string
}

func CreateDWNClient

func CreateDWNClient(urlBase string) *DWNClient

func CreateDWNClientForProtocol

func CreateDWNClientForProtocol(urlBase string, protocol string, protocolVersion string) *DWNClient

func (*DWNClient) CallDWNHTTP

func (client *DWNClient) CallDWNHTTP(messages ...*model.Message) (model.ResponseObject, error)

func (*DWNClient) GetData

func (client *DWNClient) GetData(schemaUrl string, recordId string, requestorIdentity *Identity) (*model.Message, []byte, string, error)

func (*DWNClient) SaveData

func (client *DWNClient) SaveData(schemaUrl string, data []byte, dataFormat string, dataAuthor *Identity, dataRecipient *Identity) (string, error)

func (*DWNClient) SaveHookForRecord

func (client *DWNClient) SaveHookForRecord(schemaUri string, dataRecordId string, callbackUri string, requestor *Identity) (string, error)

func (*DWNClient) SaveHookForSchemaAndProtocol

func (client *DWNClient) SaveHookForSchemaAndProtocol(schemaUri string, protocol string, protocolVersion string, callbackUri string, requestor *Identity) (string, error)

func (*DWNClient) UpdateData

func (client *DWNClient) UpdateData(schemaUrl string, logicalRecordId string, data []byte, dataFormat string, dataUpdater *Identity) error

type Identity

type Identity struct {
	DID     string
	DIDKey  *did.DIDKey
	Keypair Keypair
}

func FromKeypair

func FromKeypair(keypair Keypair) Identity

type Keypair

type Keypair struct {
	KeyType    tbdcrypto.KeyType
	PrivateKey crypto.PrivateKey
	PublicKey  crypto.PublicKey
}

func FromEd25519PrivateKey

func FromEd25519PrivateKey(privateKey ed25519.PrivateKey) Keypair

func NewKeypair

func NewKeypair() Keypair

Jump to

Keyboard shortcuts

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