Documentation ¶
Overview ¶
Package hint provides to handle struct and data with type and it's version.
Index ¶
- Variables
- func IsValidFixedType(ty Type, typesize int) error
- type BaseHinter
- type GlobalHintset
- type Hint
- func (ht Hint) Bytes() []byte
- func (ht Hint) Equal(b Hint) bool
- func (ht Hint) IsCompatible(target Hint) error
- func (ht Hint) IsValid([]byte) error
- func (ht Hint) IsZero() bool
- func (ht Hint) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (ht Hint) MarshalText() ([]byte, error)
- func (ht Hint) RawString() string
- func (ht Hint) String() string
- func (ht Hint) Type() Type
- func (ht *Hint) UnmarshalBSONValue(t bsontype.Type, b []byte) error
- func (ht *Hint) UnmarshalText(b []byte) error
- func (ht Hint) Version() string
- type Hinter
- type Hintmap
- type Hintset
- func (hs *Hintset) Add(ht Hinter) error
- func (hs *Hintset) Compatible(ht Hint) (Hinter, error)
- func (hs *Hintset) Get(ht Hint) Hinter
- func (hs *Hintset) Hinters(ty Type) []Hinter
- func (hs *Hintset) Latest(ty Type) (Hinter, error)
- func (hs *Hintset) TestAdd(ht Hinter) error
- func (hs *Hintset) Types() []Type
- type SetHinter
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxVersionLength = 20 MaxHintLength = MaxTypeLength + MaxVersionLength + 1 )
View Source
var (
_, MaxTypeLength = 2, 100
)
Functions ¶
func IsValidFixedType ¶
Types ¶
type BaseHinter ¶
type BaseHinter struct {
// contains filtered or unexported fields
}
func NewBaseHinter ¶
func NewBaseHinter(ht Hint) BaseHinter
func (BaseHinter) Hint ¶
func (ht BaseHinter) Hint() Hint
func (BaseHinter) IsValid ¶
func (ht BaseHinter) IsValid([]byte) error
func (BaseHinter) SetHint ¶
func (ht BaseHinter) SetHint(n Hint) Hinter
type GlobalHintset ¶
type GlobalHintset struct {
*Hintset
}
func NewGlobalHintset ¶
func NewGlobalHintset() *GlobalHintset
func (*GlobalHintset) Add ¶
func (hs *GlobalHintset) Add(ht Hinter) error
func (*GlobalHintset) AddType ¶
func (hs *GlobalHintset) AddType(ty Type) error
func (*GlobalHintset) HasType ¶
func (hs *GlobalHintset) HasType(ty Type) bool
func (*GlobalHintset) Initialize ¶
func (hs *GlobalHintset) Initialize() error
type Hint ¶
type Hint struct {
// contains filtered or unexported fields
}
func (Hint) IsCompatible ¶
IsCompatible checks whether target is compatible with source, ht. - Obviously, Type should be same - If same version, compatible - If major version is different, not compatible - If same major, but minor version of target is lower than source, not compatible - If same major and minor, but different patch version, compatible
func (Hint) MarshalText ¶
func (*Hint) UnmarshalBSONValue ¶
func (*Hint) UnmarshalText ¶
type Hintmap ¶
func NewHintmap ¶
func NewHintmap() *Hintmap
func (*Hintmap) Compatible ¶
func (*Hintmap) CompatibleByHint ¶
type Hintset ¶
func NewHintset ¶
func NewHintset() *Hintset
type Type ¶
type Type string // revive:disable-line:redefines-builtin-id
func ParseFixedTypedString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.