Documentation
¶
Index ¶
- Variables
- func LookupIPv4(endpoint string) string
- type BindingStore
- type DefaultPublicKeyIDSynthesizer
- type NetworkMember
- type PortName
- type PublicKeyExtractor
- type PublicKeyIDSynthesizer
- type Resolver
- type ResolverInfo
- type Service
- func (r *Service) AddPublicKeyExtractor(publicKeyExtractor PublicKeyExtractor) error
- func (r *Service) AddResolver(name string, domain string, addresses map[string]string, aliases []string, ...) (view.Identity, error)
- func (r *Service) Bind(ctx context.Context, longTerm view.Identity, ephemeral view.Identity) error
- func (r *Service) ExtractPKI(id []byte) []byte
- func (r *Service) GetIdentity(label string, pkID []byte) (view.Identity, error)
- func (r *Service) GetResolver(ctx context.Context, id view.Identity) (*Resolver, error)
- func (r *Service) IsBoundTo(ctx context.Context, a view.Identity, b view.Identity) bool
- func (r *Service) PkiResolve(resolver *Resolver) []byte
- func (r *Service) RemoveResolver(id view.Identity) (bool, error)
- func (r *Service) Resolve(ctx context.Context, id view.Identity) (view.Identity, map[PortName]string, []byte, error)
- func (r *Service) ResolveIdentities(endpoints ...string) ([]view.Identity, error)
- func (r *Service) Resolver(ctx context.Context, id view.Identity) (*Resolver, []byte, error)
- func (r *Service) Resolvers() []ResolverInfo
- func (r *Service) SetPublicKeyIDSynthesizer(publicKeyIDSynthesizer PublicKeyIDSynthesizer)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound signals that a resolver was not found ErrNotFound = errors.New("not found") )
Functions ¶
func LookupIPv4 ¶
Types ¶
type BindingStore ¶
type BindingStore = cdriver.BindingStore
type DefaultPublicKeyIDSynthesizer ¶
type DefaultPublicKeyIDSynthesizer struct{}
func (DefaultPublicKeyIDSynthesizer) PublicKeyID ¶
func (d DefaultPublicKeyIDSynthesizer) PublicKeyID(key any) []byte
type NetworkMember ¶
NetworkMember is a peer's representation
type PortName ¶
type PortName string
PortName is the type variable for the socket ports
const ( // ListenPort is the port at which the FSC node might listen for some service ListenPort PortName = "Listen" // ViewPort is the port on which the View Service Server respond ViewPort PortName = "View" // P2PPort is the port on which the P2P Communication Layer respond P2PPort PortName = "P2P" )
type PublicKeyExtractor ¶
type PublicKeyExtractor interface {
// ExtractPublicKey returns the public key corresponding to the passed identity
ExtractPublicKey(id view.Identity) (any, error)
}
PublicKeyExtractor extracts public keys from identities
type PublicKeyIDSynthesizer ¶
type Resolver ¶
type Resolver struct {
ResolverInfo
PKILock sync.RWMutex
}
Resolver wraps ResolverInfo with additional management fields
func (*Resolver) GetAddress ¶
func (*Resolver) GetAddresses ¶
type ResolverInfo ¶
type ResolverInfo struct {
ID []byte
Name string
Domain string
Addresses map[PortName]string
AddressList []string
Aliases []string
PKI []byte
}
ResolverInfo carries information about a resolver
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
GetService returns an instance of the endpoint service. It panics, if no instance is found.
func NewService ¶
func NewService(bindingKVS BindingStore) (*Service, error)
NewService returns a new instance of the view-sdk endpoint service
func (*Service) AddPublicKeyExtractor ¶
func (r *Service) AddPublicKeyExtractor(publicKeyExtractor PublicKeyExtractor) error
func (*Service) AddResolver ¶
func (r *Service) AddResolver( name string, domain string, addresses map[string]string, aliases []string, id []byte, ) (view.Identity, error)
AddResolver adds a new resolver.
func (*Service) ExtractPKI ¶
func (*Service) GetIdentity ¶
func (*Service) GetResolver ¶
func (*Service) PkiResolve ¶
func (*Service) RemoveResolver ¶
RemoveResolver first check if a resolver is bound to the passed identity. If yes, the function removes the resolver. If no, the function does nothing.
func (*Service) Resolve ¶
func (r *Service) Resolve(ctx context.Context, id view.Identity) (view.Identity, map[PortName]string, []byte, error)
Resolve returns the endpoints of the passed identity. If the passed identity does not have any endpoint set, the service checks if the passed identity is bound to another identity that is returned together with its endpoints and public-key identifier.
func (*Service) ResolveIdentities ¶
func (*Service) Resolvers ¶
func (r *Service) Resolvers() []ResolverInfo
func (*Service) SetPublicKeyIDSynthesizer ¶
func (r *Service) SetPublicKeyIDSynthesizer(publicKeyIDSynthesizer PublicKeyIDSynthesizer)