documents

package
v0.0.0-...-96bc9f9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadJSONPayload       = errors.New("bad json payload")
	ErrResponseBadSignature = errors.New("bad response signature")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	SelfID         string
	DeviceID       string
	PrivateKey     ed25519.PrivateKey
	Rest           restTransport
	KeyID          string
	Messaging      messagingClient
	PKI            pkiClient
	FileInteractor remoteFile
}

Config stores all configuration needed by the messaging service

type InputObject

type InputObject struct {
	Name string
	Data []byte
	Mime string
}

type Response

type Response struct {
	Signature     string
	SignedObjects []SignedObject `json:"signed_objects"`
	Status        string         `json:"status"`
}

type Service

type Service struct {
	URL string
	// contains filtered or unexported fields
}

Service handles all messaging operations

func NewService

func NewService(cfg Config) *Service

NewService creates a new client for interacting with messaging

func (*Service) RequestSignature

func (s *Service) RequestSignature(recipient string, body string, objects []InputObject) (Response, error)

RequestSignature sends a signature request to the specified user.

type SignedObject

type SignedObject struct {
	Name string `json:"name"`
	Link string `json:"link"`
	Hash string `json:"hash"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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