Documentation
¶
Index ¶
- Variables
- func AddScope(scope []string, names ...string) []string
- func AppendTag(dst []byte, typ EtagType, oid int64, ver int32) []byte
- func DecodeTag(s string) (typ EtagType, tag Tid, err error)
- func EncodeEtag(typ EtagType, oid int64, ver int32) (string, error)
- func EncodeTag(typ EtagType, tag Tid) (string, error)
- func FieldsCopy(fields []string) []string
- func FieldsFunc(src []string, fn func(string) []string) []string
- func GetId(typ EtagType, oid int64) (id string, err error)
- func GetOid(typ EtagType, id string) (oid int64, err error)
- func HasScope(scope []string, name string) bool
- func InlineFields(selector string) []string
- func MergeFields(dst, src []string) []string
- func MustId(typ EtagType, id string, err error) string
- func Name(s string) string
- func SelectFields(userattrs, operational []string) func(string) []string
- func UniqueId(this, that INode) error
- type Constraint
- type ETag
- type EtagType
- type IList
- type INode
- type IRemovable
- type IVersional
- type IVisitor
- type ProtoMessage
- type Tag
- type Tid
- type Tids
- type UniqueConstraint
Constants ¶
This section is empty.
Variables ¶
var ETagEncoding = base32.NewEncoding(encodeEtag).WithPadding(base32.NoPadding)
ETagEncoding is base32.Encoding for human-readable text presentation of internal ETag values
Functions ¶
func AddScope ¶
AddScope appends UNIQUE(+lower) names to scope and returns, optionaly new, scope slice
func FieldsCopy ¶
FieldsCopy returns copy of unique set of given fields, all are in lower case
func FieldsFunc ¶
FieldsFunc normalize a selection list src of the attributes to be returned.
- An empty list with no attributes requests the return of all user attributes.
- A list containing "*" (with zero or more attribute descriptions) requests the return of all user attributes in addition to other listed (operational) attributes.
e.g.: ['id,name','display'] returns ['id','name','display']
func InlineFields ¶
InlineFields explode inline 'attr,attr2 attr3' selector as ['attr','attr2','attr3']
func MergeFields ¶
MergeFields appends unique set from src to dst.
func SelectFields ¶
SelectFields maps['*':userattrs, '+':userattrs+allattrs]
Types ¶
type Constraint ¶
Constraint checks given this INode for data integrity violations.
type EtagType ¶
type EtagType uint32
EtagType represents the [E]Tag object type reference.
const ( NoType EtagType = iota // NoType represents an unknown or invalid type EtagCase // Case type EtagCaseComment // Case Comment type EtagCaseLink // Case Link type EtagRelatedCase // Case Related case type EtagCaseCommunication // Case Related case type )
Case-related ETag types are declared here. **For generating string : ** go install golang.org/x/tools/cmd/stringer@latest echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc source ~/.zshrc go generate ./... **Commands**
type INode ¶
type INode interface {
// GetId MUST return an unique identifier of this data node.
GetId() string
// FIXME: Accept: proto.Message(s)
ProtoMessage
}
INode interface represents single data node within contacts package schema.
type IRemovable ¶
type IRemovable interface {
// Positive timestamp indicates that this source
// was temporary removed from main view.
GetDeletedAt() int64
}
IRemovable interface
type IVersional ¶
type IVersional interface {
// MUST implements INode
INode
// GetVertion returns latest revision(version) number of this data node.
GetVer() int32
}
IVersional interface
type ProtoMessage ¶
type ProtoMessage = protoreflect.ProtoMessage
ProtoMessage reflects: - google.golang.org/protobuf/proto.Message - github.com/golang/protobuf/proto.MessageV2() protoV2.Message
type Tid ¶
type Tid struct {
// OPTIONAL. Tuple revision number.
// Zero-based integer sequence number.
// REQUIRED. As a part of ETag identifier.
Ver *int32
// REQUIRED. Tuple unique identifier.
// Positive non-zero integer number.
Oid int64
}
The [T]uple [ID]entifier is a pointer to a specific version of the unique tuple.
func ExpectEtag ¶
ExpectETag parses a given string as an ETag string of the expected reference type.
func GetTag ¶
func GetTag(node IVersional, typ EtagType) (tag Tid, err error)
GetTag from given node dynamically uses the type
func (*Tid) GetId ¶
GetId returns string format of the Oid identifier dynamically using the passed type.
func (*Tid) HasVer ¶
HasVer reports whether the tuple version is associated. True means e was build from -or- can be used for ETag identifier.
type UniqueConstraint ¶
UniqueConstraint checks given INode(s) for violations of data uniqueness.