endp

package
v0.25.31 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DIDLengthMax = 22
View Source
const DIDLengthMin = 21

Variables

This section is empty.

Functions

func IsDID

func IsDID(DID string) bool

func IsInEndpoints

func IsInEndpoints(endpointName string) bool

Types

type Addr

type Addr struct {
	ID        uint64 // ID is used to save Payloads arriving into the Address
	Service   string // Service name like findy for http
	PlRcvr    string // PL receiver it is CA-DID (our CA) todo: CA or WA?
	MsgRcvr   string // Receivers CA-DID which is used for Edge/Cloud communication
	RcvrDID   string // This is the pairwise DID
	EdgeToken string // Final communication endpoint, now used for invitation ID
	BasePath  string // The base address of the URL
	VerKey    string // Associated VerKey, used for sending Payloads to this address
}

Addr is one of the central types in the Findy Agency. It handles the connections both for server and client. It caries mostly the URL specific stuff and DID parsing logic. There is also WebSocket connection. In the future there might be some other elements as well. This is right place. The name of the type should be changed to something else like CnxAddr, end need for exportation should be considered.

func NewAddrFromPublic

func NewAddrFromPublic(ae service.Addr) *Addr

func NewClientAddr

func NewClientAddr(s string) (ea *Addr)

NewClientAddr creates and fills new object from string which holds full URL of the address, including base address as well. This can and should be used for cases where whole endpoint address is given.

func NewClientAddrWithKey

func NewClientAddrWithKey(fullURL, verkey string) *Addr

func NewServerAddr

func NewServerAddr(s string) (ea *Addr)

NewServerAddr creates and fills new object from string usually got from service calls like HTTP POST request. For that reason it cannot fill base address field.

func (*Addr) AE

func (e *Addr) AE() service.Addr

AE returns Addr which includes URL + VerKey.

func (*Addr) Address

func (e *Addr) Address() string

func (*Addr) IsEncrypted

func (e *Addr) IsEncrypted() bool

func (*Addr) Key

func (e *Addr) Key() []byte

func (*Addr) MsgLevelDID

func (e *Addr) MsgLevelDID() string

MsgLevelDID returns the actual agent who receives and handles the PL. Note! it's safer to use RcvrDID field instead!

func (*Addr) PayloadTransportDID

func (e *Addr) PayloadTransportDID() string

func (*Addr) ReceiverDID

func (e *Addr) ReceiverDID() string

ReceiverDID returns actual agent PL receiver.

func (*Addr) String

func (e *Addr) String() string

func (*Addr) TestAddress

func (e *Addr) TestAddress() string

func (*Addr) Valid

func (e *Addr) Valid() bool

Jump to

Keyboard shortcuts

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