common

package module
v0.0.0-...-d7b0689 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountIdsToStrings

func AccountIdsToStrings(accountIds []AccountId) []string

func ContactsToPB

func ContactsToPB(contacts []Contact) []*pb.UserContact

Types

type AccountId

type AccountId string

func NewAccountId

func NewAccountId(id string) AccountId

func NilAccountId

func NilAccountId() AccountId

func StringsToAccountIds

func StringsToAccountIds(accountIds []string) []AccountId

func (AccountId) String

func (a AccountId) String() string

type Address

type Address struct {
	Ip   net.IP
	Port int
}

func NewAddress

func NewAddress(ip net.IP, port int) Address

func NewAddressFromPB

func NewAddressFromPB(c *pb.ClientAddress) Address

func (Address) Equal

func (s Address) Equal(addr Address) bool

func (Address) GetURL

func (u Address) GetURL() string

func (Address) String

func (s Address) String() string

func (Address) ToPB

func (a Address) ToPB() *pb.ClientAddress

type CallCtx

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

func NewCallCtx

func NewCallCtx(log zerolog.Logger) CallCtx

func NewCallCtxWithApp

func NewCallCtxWithApp(app string) CallCtx

func (CallCtx) Debug

func (c CallCtx) Debug() *zerolog.Event

func (CallCtx) Error

func (c CallCtx) Error() *zerolog.Event

func (CallCtx) Fatal

func (c CallCtx) Fatal() *zerolog.Event

func (CallCtx) Info

func (c CallCtx) Info() *zerolog.Event

func (CallCtx) Log

func (c CallCtx) Log() *zerolog.Logger

func (CallCtx) NewCtx

func (c CallCtx) NewCtx(name string) CallCtx

func (CallCtx) Panic

func (c CallCtx) Panic() *zerolog.Event

func (CallCtx) Printf

func (c CallCtx) Printf(format string, v ...interface{})

func (CallCtx) Trace

func (c CallCtx) Trace() *zerolog.Event

func (CallCtx) Warn

func (c CallCtx) Warn() *zerolog.Event

type Contact

type Contact struct {
	AccountId AccountId
	Address   Address
}

func NewContact

func NewContact(accountId AccountId, ip net.IP, port int) Contact

func NewContactFromPB

func NewContactFromPB(c *pb.UserContact) Contact

func (Contact) String

func (c Contact) String() string

func (Contact) ToPB

func (c Contact) ToPB() *pb.UserContact

type Myself

type Myself interface {
	GetMe() Contact
}

func NewTestMyself

func NewTestMyself(id string, port int) Myself

type TestMyself

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

func (*TestMyself) GetMe

func (m *TestMyself) GetMe() Contact

Jump to

Keyboard shortcuts

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