endpoint

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupIPv4

func LookupIPv4(endpoint string) string

Types

type Backend added in v0.4.0

type Backend interface {
	Bind(longTerm view.Identity, ephemeral view.Identity) error
	AddResolver(name string, domain string, addresses map[string]string, aliases []string, id []byte) (view.Identity, error)
}

type ConfigService

type ConfigService interface {
	GetString(key string) string
	IsSet(s string) bool
	UnmarshalKey(s string, i interface{}) error
	TranslatePath(path string) string
}

type DefaultPublicKeyIDSynthesizer added in v0.4.0

type DefaultPublicKeyIDSynthesizer struct{}

func (DefaultPublicKeyIDSynthesizer) PublicKeyID added in v0.4.0

func (d DefaultPublicKeyIDSynthesizer) PublicKeyID(key any) []byte

type Discovery

type Discovery interface {
	Peers() []NetworkMember
}

type Identity

type Identity struct {
	Path string `yaml:"path"`
}

type IdentityService

type IdentityService interface {
	DefaultIdentity() view.Identity
}

type KVS

type KVS interface {
	Exists(id string) bool
	Put(id string, state interface{}) error
	Get(id string, state interface{}) error
}

type NetworkMember

type NetworkMember struct {
	Endpoint         string
	Metadata         []byte
	PKIid            []byte
	InternalEndpoint string
}

NetworkMember is a peer's representation

type Resolver added in v0.4.0

type Resolver struct {
	Name           string
	Domain         string
	Addresses      map[driver.PortName]string
	Aliases        []string
	PKI            []byte
	PKILock        sync.RWMutex
	Id             []byte
	IdentityGetter func() (view.Identity, []byte, error)
}

func (*Resolver) GetIdentity added in v0.4.0

func (r *Resolver) GetIdentity() (view.Identity, error)

type ResolverService added in v0.4.0

type ResolverService struct {
	// contains filtered or unexported fields
}

func NewResolverService

func NewResolverService(config ConfigService, backend Backend, is IdentityService) (*ResolverService, error)

NewResolverService returns a new instance of the view-sdk endpoint resolverService

func (*ResolverService) LoadResolvers added in v0.4.0

func (r *ResolverService) LoadResolvers() error

type Service

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

func NewService

func NewService(kvs KVS) (*Service, error)

NewService returns a new instance of the view-sdk endpoint service

func (*Service) AddPublicKeyExtractor added in v0.4.0

func (r *Service) AddPublicKeyExtractor(publicKeyExtractor driver.PublicKeyExtractor) error

func (*Service) AddResolver

func (r *Service) AddResolver(name string, domain string, addresses map[string]string, aliases []string, id []byte) (view.Identity, error)

func (*Service) Bind

func (r *Service) Bind(longTerm view.Identity, ephemeral view.Identity) error

func (*Service) Endpoint added in v0.4.0

func (r *Service) Endpoint(party view.Identity) (map[driver.PortName]string, error)

func (*Service) ExtractPKI added in v0.4.0

func (r *Service) ExtractPKI(id []byte) []byte

func (*Service) GetIdentity added in v0.4.0

func (r *Service) GetIdentity(endpoint string, pkID []byte) (view.Identity, error)

func (*Service) IsBoundTo added in v0.4.0

func (r *Service) IsBoundTo(a view.Identity, b view.Identity) bool

func (*Service) Resolve added in v0.4.0

func (r *Service) Resolve(party view.Identity) (string, view.Identity, map[driver.PortName]string, []byte, error)

func (*Service) SetPublicKeyIDSynthesizer added in v0.4.0

func (r *Service) SetPublicKeyIDSynthesizer(publicKeyIDSynthesizer driver.PublicKeyIDSynthesizer)

Jump to

Keyboard shortcuts

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