ident

package
v0.0.0-...-407825d Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCAddress

func NewGRPCAddress(addr Address) *grpc.Address

NewGRPCAddress creates a grcp.ServiceIdentity from a Address

func NewGRPCDomainRecord

func NewGRPCDomainRecord(domainRecord DomainRecord) *grpc.DomainRecord

func NewGRPCDomainRecordList

func NewGRPCDomainRecordList(domainRecords []DomainRecord) []*grpc.DomainRecord

func NewGRPCIdentity

func NewGRPCIdentity(ident Identity) *grpc.Identity

NewGRPCIdentity creates a grcp.ServiceIdentity from a Identity

func NewGRPCIdentityList

func NewGRPCIdentityList(dIdents []Identity) []*grpc.Identity

NewGRPCIdentityList creates a list of new Identitys from a list of grpc.Identity

func NewGRPCServiceIdentity

func NewGRPCServiceIdentity(sIdent ServiceIdentity) *grpc.ServiceIdentity

NewGRPCServiceIdentity creates a grpc.ServiceIdentity from a ServiceIdentity

func NewGRPCServiceIdentityList

func NewGRPCServiceIdentityList(sIdents []ServiceIdentity) []*grpc.ServiceIdentity

NewGRPCServiceIdentityList creates a list of new ServiceIdentitys from a list of grpc.ServiceIdentity

Types

type Address

type Address struct {
	// IP is the ip which the Domain will be responding on
	IP net.IP
	// Port is the port which the Domain will be responding on
	Port int
}

Address is a IP and port combination

func NewAddress

func NewAddress(grpcAddr *grpc.Address) Address

NewAddress creates a Address from a grcp.Address

func (Address) String

func (a Address) String() string

type DomainRecord

type DomainRecord struct {
	// Identity holds the identifying information of the domain
	Identity

	// Services
	Services []ServiceIdentity
}

func NewDomainRecord

func NewDomainRecord(grpcDomainRecord *grpc.DomainRecord) (DomainRecord, error)

func NewDomainRecordList

func NewDomainRecordList(grpcDomainRecords []*grpc.DomainRecord) ([]DomainRecord, error)

type Identity

type Identity struct {
	// ID is a unique identifier
	ID uuid.UUID
	// Version is the version of code being run
	Version semver.Version
	// Address is a network address
	Address Address
}

Identity is a set of identifying information

func NewIdentity

func NewIdentity(grpcIdent *grpc.Identity) (Identity, error)

NewIdentity creates a Identity from a grcp.Identity

func NewIdentityList

func NewIdentityList(grpcDIdents []*grpc.Identity) ([]Identity, error)

NewIdentityList creates a list of new Identitys from a list of grpc.Identity

func (Identity) String

func (i Identity) String() string

type ServiceIdentity

type ServiceIdentity struct {
	// Identity holds identifying information
	Identity
	// Type is the type of the service
	Type string
}

ServiceIdentity represents a service running under a domain

func NewServiceIdentity

func NewServiceIdentity(grpcSIdent *grpc.ServiceIdentity) (ServiceIdentity, error)

NewServiceIdentity creates a ServiceIdentity from a grpc.ServiceIdentity

func NewServiceIdentityList

func NewServiceIdentityList(grpcSIdents []*grpc.ServiceIdentity) ([]ServiceIdentity, error)

NewServiceIdentityList creates a list of new ServiceIdentitys from a list of grpc.ServiceIdentity

func (ServiceIdentity) String

func (i ServiceIdentity) String() string

Jump to

Keyboard shortcuts

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