rpcutil

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EOF rune = -(iota + 1)
)

Variables

View Source
var (
	ErrParseError = errors.New("Parse Error")
)

Functions

func NewTokenizer

func NewTokenizer(src string) *tokenizer

Types

type Record

type Record struct {
	Key_     string            `json:"key"`
	Name_    string            `json:"name"`
	Host_    string            `json:"host"`
	Service_ string            `json:"service"`
	Port_    uint              `json:"port,omitempty"`
	Txt_     []string          `json:"txt,omitempty"`
	Ipv4_    []net.IP          `json:"ipv4,omitempty"`
	Ipv6_    []net.IP          `json:"ipv6,omitempty"`
	Ts_      *timestamp        `json:"ts,omitempty"`
	Ttl_     *duration         `json:"ttl,omitempty"`
	Source_  rpc.DiscoveryType `json:"source,omitempty"`
}

Record implements a gopi.RPCServiceRecord

func (*Record) AppendIP

func (this *Record) AppendIP(ips ...net.IP) error

func (*Record) AppendTXT

func (this *Record) AppendTXT(value string) error

func (*Record) Expired

func (this *Record) Expired() bool

func (*Record) Host

func (this *Record) Host() string

func (*Record) IP4

func (this *Record) IP4() []net.IP

func (*Record) IP6

func (this *Record) IP6() []net.IP

func (*Record) Key

func (this *Record) Key() string

func (*Record) Name

func (this *Record) Name() string

func (*Record) Port

func (this *Record) Port() uint

func (*Record) Service

func (this *Record) Service() string

Service returns the service type and protocol, including the underscores but removes the subtype information

func (*Record) SetAddr

func (this *Record) SetAddr(addr string) error

func (*Record) SetName

func (this *Record) SetName(name string) error

SetName sets the name of the service instance

func (*Record) SetPTR

func (this *Record) SetPTR(zone string, rr *dns.PTR) error

SetPTR sets from PTR record

func (*Record) SetSRV

func (this *Record) SetSRV(rr *dns.SRV) error

func (*Record) SetService

func (this *Record) SetService(service, subtype string) error

Set service type, subtype and IP protocol

func (*Record) SetTTL

func (this *Record) SetTTL(d time.Duration) error

func (*Record) SetTXT

func (this *Record) SetTXT(txt []string) error

func (*Record) Source

func (this *Record) Source() rpc.DiscoveryType

Source returns the source of the record

func (*Record) String

func (s *Record) String() string

func (*Record) Subtype

func (this *Record) Subtype() string

Subtype returns the service subtype, but not including the underscore

func (*Record) TTL

func (this *Record) TTL() time.Duration

func (*Record) Text

func (this *Record) Text() []string

func (*Record) Timestamp

func (this *Record) Timestamp() time.Time

type Util

type Util struct {
}

func (Util) Open

func (config Util) Open(log gopi.Logger) (gopi.Driver, error)

Open a client

Jump to

Keyboard shortcuts

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