Documentation ¶
Index ¶
- Constants
- func IsDID(DID string) bool
- func IsInEndpoints(endpointName string) bool
- type Addr
- func (e *Addr) AE() service.Addr
- func (e *Addr) Address() string
- func (e *Addr) IsEncrypted() bool
- func (e *Addr) Key() []byte
- func (e *Addr) MsgLevelDID() string
- func (e *Addr) PayloadTransportDID() string
- func (e *Addr) ReceiverDID() string
- func (e *Addr) String() string
- func (e *Addr) TestAddress() string
- func (e *Addr) Valid() bool
Constants ¶
const DIDLengthMax = 22
const DIDLengthMin = 21
Variables ¶
This section is empty.
Functions ¶
func IsInEndpoints ¶
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 NewClientAddr ¶
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 NewServerAddr ¶
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) IsEncrypted ¶
func (*Addr) MsgLevelDID ¶
MsgLevelDID returns the actual agent who receives and handles the PL. Note! it's safer to use RcvrDID field instead!
func (*Addr) PayloadTransportDID ¶
func (*Addr) ReceiverDID ¶
ReceiverDID returns actual agent PL receiver.