endp

package
v0.24.9 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 7 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 and findyws for websockets
	PlRcvr    string // PL receiver which can be Agency cmd: 'handshake', and others, or it can be CA-DID (our CA)
	MsgRcvr   string // Receivers CA-DID which is used for Edge/Cloud communication
	RcvrDID   string // This is the FINAL msg receiver which is the actual target of the msg, can decrypt the msg
	EdgeToken string // Final communication endpoint like APNS Device Token
	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