id

package
v0.0.0-...-71fdcac Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: BSD-3-Clause Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallId

type CallId IdRoot[DefCall]

func CallIdEmptyValue

func CallIdEmptyValue() CallId

func CallIdFromPair

func CallIdFromPair(high, low uint64) CallId

FromPair is probably not something you want to use unless you are pulling values from external storage or files. If you pulling values from the network, use the Marshal() ad Unmarshal() functions to work with Ids. Absolutely no checking is done on the values provided, so much caution is advised.

func CallIdZeroValue

func CallIdZeroValue() CallId

func NewCallId

func NewCallId() CallId

func UnmarshalCallId

func UnmarshalCallId(b *protosupport.IdRaw) CallId

func (CallId) Equal

func (f CallId) Equal(other CallId) bool

func (CallId) High

func (f CallId) High() uint64

func (CallId) IsEmptyValue

func (f CallId) IsEmptyValue() bool

func (CallId) IsZeroOrEmptyValue

func (f CallId) IsZeroOrEmptyValue() bool

func (CallId) IsZeroValue

func (f CallId) IsZeroValue() bool

func (CallId) Low

func (f CallId) Low() uint64

func (CallId) Marshal

func (f CallId) Marshal() *protosupport.IdRaw

func (CallId) Short

func (f CallId) Short() string

func (CallId) String

func (f CallId) String() string

type DefCall

type DefCall struct{}

func (DefCall) Letter

func (f DefCall) Letter() byte

func (DefCall) ShortString

func (f DefCall) ShortString() string

type DefHost

type DefHost struct{}

func (DefHost) Letter

func (f DefHost) Letter() byte

func (DefHost) ShortString

func (f DefHost) ShortString() string

type DefMethod

type DefMethod struct{}

func (DefMethod) Letter

func (f DefMethod) Letter() byte

func (DefMethod) ShortString

func (f DefMethod) ShortString() string

type DefService

type DefService struct{}

func (DefService) Letter

func (f DefService) Letter() byte

func (DefService) ShortString

func (f DefService) ShortString() string

type HostId

type HostId IdRoot[DefHost]

func HostIdEmptyValue

func HostIdEmptyValue() HostId

func HostIdFromPair

func HostIdFromPair(high, low uint64) HostId

FromPair is probably not something you want to use unless you are pulling values from external storage or files. If you pulling values from the network, use the Marshal() ad Unmarshal() functions to work with Ids. Absolutely no checking is done on the values provided, so much caution is advised.

func HostIdZeroValue

func HostIdZeroValue() HostId

func NewHostId

func NewHostId() HostId

func UnmarshalHostId

func UnmarshalHostId(b *protosupport.IdRaw) HostId

func (HostId) Equal

func (f HostId) Equal(other HostId) bool

func (HostId) High

func (f HostId) High() uint64

func (HostId) IsEmptyValue

func (f HostId) IsEmptyValue() bool

func (HostId) IsZeroOrEmptyValue

func (f HostId) IsZeroOrEmptyValue() bool

func (HostId) IsZeroValue

func (f HostId) IsZeroValue() bool

func (HostId) Low

func (f HostId) Low() uint64

func (HostId) Marshal

func (f HostId) Marshal() *protosupport.IdRaw

func (HostId) Short

func (f HostId) Short() string

func (HostId) String

func (f HostId) String() string

type IdRoot

type IdRoot[T NameInfo] struct {
	// contains filtered or unexported fields
}

IdRoot[T] is used to indicate an id in parigot. This type is usually "covered up" by generated code that will given it a name lile FileId or QueueId so these types cannot be compared for equality, assigned to each other, and similar, despite being the same underlying type.

func NewIdRoot

func NewIdRoot[T NameInfo]() IdRoot[T]

NewIdRoot[T] returns a new Id of type[T] fille with 120 bits of randomness.

func NewIdTyped

func NewIdTyped[T NameInfo](h, l uint64) IdRoot[T]

NewIdType is dangerous in that it performs no checks about the validity of the data provided. Its use is discouraged. It will obey the values provided by the T type parameter regarding the high order byte, even if this value is provided in h.

func ZeroValue

func ZeroValue[T NameInfo]() IdRoot[T]

ZeroValue is a special value of an id. Thes should be returned when an Id should not be used, such as when an error is also returned from a function. Note that the zero value is not the same as the empty value.

func (IdRoot[T]) Equal

func (i IdRoot[T]) Equal(other IdRoot[T]) bool

Equal will compare two ids for equality. At this level it can compare _any_ two ids, but most users will be using generated code that disallows comparisons between id types. Note that the empty value and the zero value are not equal to anything, including each other.

func (IdRoot[T]) High

func (i IdRoot[T]) High() uint64

Use of High() is not recommended for user code. It returns the high 8 bytes of the 128bit id.

func (IdRoot[T]) IsEmptyValue

func (i IdRoot[T]) IsEmptyValue() bool

IsEmptyValue tells you if the given id is actually just full of zeros in the 15 data bytes. This almost means that the caller gave you a bad id, since the chance of all 15 data bytes being zero is very low, and vastly lower than somebody forgetting to initialize a value.

func (IdRoot[T]) IsZeroOrEmptyValue

func (i IdRoot[T]) IsZeroOrEmptyValue() bool

func (IdRoot[T]) IsZeroValue

func (i IdRoot[T]) IsZeroValue() bool

IsZeroValue checks an id value to see if it is the bit pattern of the zero value.

func (IdRoot[T]) Low

func (i IdRoot[T]) Low() uint64

Use of Low() is not recommended for user code. It returns the low 8 bytes of the 128bit id.

func (IdRoot[T]) Short

func (i IdRoot[T]) Short() string

Short returns a short string representing this value. Strings returned represent the low order 16 bits of the this Id. However, for debugging, this amount data is enough to uniquely identify a particular id. If you want to see the entire 120 bits, then use String().

func (IdRoot[T]) String

func (i IdRoot[T]) String() string

String() returns a string that contains the short string name of this id (like "file" or "queue") and then 5 groups of numbers. From left to right these are bytes[4-6] of the high part, bytes[0-3] of the high part, bytes [4-7] of the low part, bytes[2-3] of the low part, and then low order two bytes of the low part. The low part is printed this way so the last section of the string match the portion of the id printed by Short()

func (IdRoot[V]) WriteGuestLe

func (i IdRoot[V]) WriteGuestLe(mem api.Memory, offset uint32) bool

WriteGuestLe will write an id into the guest memory when running on the host. This always writes the data in Little Endian format.

type MethodId

type MethodId IdRoot[DefMethod]

func MethodIdEmptyValue

func MethodIdEmptyValue() MethodId

func MethodIdFromPair

func MethodIdFromPair(high, low uint64) MethodId

FromPair is probably not something you want to use unless you are pulling values from external storage or files. If you pulling values from the network, use the Marshal() ad Unmarshal() functions to work with Ids. Absolutely no checking is done on the values provided, so much caution is advised.

func MethodIdZeroValue

func MethodIdZeroValue() MethodId

func NewMethodId

func NewMethodId() MethodId

func UnmarshalMethodId

func UnmarshalMethodId(b *protosupport.IdRaw) MethodId

func (MethodId) Equal

func (f MethodId) Equal(other MethodId) bool

func (MethodId) High

func (f MethodId) High() uint64

func (MethodId) IsEmptyValue

func (f MethodId) IsEmptyValue() bool

func (MethodId) IsZeroOrEmptyValue

func (f MethodId) IsZeroOrEmptyValue() bool

func (MethodId) IsZeroValue

func (f MethodId) IsZeroValue() bool

func (MethodId) Low

func (f MethodId) Low() uint64

func (MethodId) Marshal

func (f MethodId) Marshal() *protosupport.IdRaw

func (MethodId) Short

func (f MethodId) Short() string

func (MethodId) String

func (f MethodId) String() string

type NameInfo

type NameInfo interface {
	ShortString() string
	Letter() byte
}

type ServiceId

type ServiceId IdRoot[DefService]

func NewServiceId

func NewServiceId() ServiceId

func ServiceIdEmptyValue

func ServiceIdEmptyValue() ServiceId

func ServiceIdFromPair

func ServiceIdFromPair(high, low uint64) ServiceId

FromPair is probably not something you want to use unless you are pulling values from external storage or files. If you pulling values from the network, use the Marshal() ad Unmarshal() functions to work with Ids. Absolutely no checking is done on the values provided, so much caution is advised.

func ServiceIdZeroValue

func ServiceIdZeroValue() ServiceId

func UnmarshalServiceId

func UnmarshalServiceId(b *protosupport.IdRaw) ServiceId

func (ServiceId) Equal

func (f ServiceId) Equal(other ServiceId) bool

func (ServiceId) High

func (f ServiceId) High() uint64

func (ServiceId) IsEmptyValue

func (f ServiceId) IsEmptyValue() bool

func (ServiceId) IsZeroOrEmptyValue

func (f ServiceId) IsZeroOrEmptyValue() bool

func (ServiceId) IsZeroValue

func (f ServiceId) IsZeroValue() bool

func (ServiceId) Low

func (f ServiceId) Low() uint64

func (ServiceId) Marshal

func (f ServiceId) Marshal() *protosupport.IdRaw

func (ServiceId) Short

func (f ServiceId) Short() string

func (ServiceId) String

func (f ServiceId) String() string

Jump to

Keyboard shortcuts

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