Documentation
¶
Overview ¶
cSpell:ignore gonic, orgs, sharded
cSpell:ignore bson, gonic, paulo ferreira, userro
cSpell:ignore bson, gonic, paulo ferreira, userro
cSpell:ignore dword, ferreira, otype, paulo, qword
cSpell:ignore gonic, orgs, paulo, ferreira
Index ¶
- Constants
- func CodeToMessage(code int) (int, string)
- func ConfigProperty(source map[string]interface{}, path string, dvalue interface{}) interface{}
- func ConfigPropertyFloat64(source map[string]interface{}, path string, dvalue float64, nested error) (float64, error)
- func ConfigPropertyINT(source map[string]interface{}, path string, dvalue int64, nested error) (int64, error)
- func ConfigPropertyObject(source map[string]interface{}, path string, dvalue map[string]interface{}, ...) (map[string]interface{}, error)
- func ConfigPropertyString(source map[string]interface{}, path string, dvalue string, nested error) (string, error)
- func ConfigPropertyUINT(source map[string]interface{}, path string, dvalue uint64, nested error) (uint64, error)
- func IsObjectOfType(global uint64, t uint16) bool
- func LocalIDFromID(global uint64) uint32
- func ObjectTypeFromID(global uint64) uint16
- func RandomGlobalID(group uint16, otype uint16, id uint32) uint64
- func RandomShardID() uint32
- func ShardFromID(global uint64) uint32
- func ShardGlobalID(group uint16, otype uint16, shard uint32, id uint32) uint64
- func ShardGroupFromID(global uint64) uint16
- func ShardInfoFromID(global uint64) uint32
- func StringEmptyOnNil(s *string) string
- func StringNilOnEmpty(s string) *string
- func UTCTimeStamp() string
- type DBConnection
- type DBShard
- type DBShardGroup
- type Server
- type ShardedDatabase
- type StoreSession
- func (o *StoreSession) ExpireHex() string
- func (o *StoreSession) ExpireTime() *time.Time
- func (o *StoreSession) ExpireUnix() int64
- func (o *StoreSession) Export() (string, error)
- func (o *StoreSession) Extend(d uint16) int64
- func (o *StoreSession) ExtendBy() uint16
- func (o *StoreSession) Import(v string) error
- func (o *StoreSession) IsExpired() bool
- func (o *StoreSession) IsValid() bool
- func (o *StoreSession) Key() []byte
- func (o *StoreSession) KeyHex() string
- func (o *StoreSession) SetExtendBy(by uint16) (uint16, error)
- func (o *StoreSession) Store() uint64
- func (o *StoreSession) StoreHex() string
Constants ¶
const BYTE_BITS = 8
const DWORD_BITS = 32
const LOCAL_ID_BITS = 32 // NUMBER of BITS Used for LOCAL ID
LOCAL ID BIT MANAGEMENT
const LOCAL_ID_DWORD_OFFSET = 0 // BIT OFFSET in DWORD (uint32)
const LOCAL_ID_QWORD_OFFSET = 0 // BIT OFFSET in QWORD (uint64)
const LOCAL_QWORD_MASK = uint64(0x00000000FFFFFFFF) // LOWER DWORD
const OTYPE_ACTION = uint16(0x00FB) // ACTION Object
const OTYPE_BITS = 8 // OBJECT TYPE in GLOBAL ID
OBJECT TYPE BIT MANAGEMENT
const OTYPE_DWORD_MASK = uint32(0x00FF0000) // OBJECT TYPE BITS
const OTYPE_DWORD_OFFSET = 16 // BIT OFFSET in DWORD (uint32)
const OTYPE_INVITATION = uint16(0x00FE) // INVITATION Object
const OTYPE_KEY = uint16(0x00FD) // KEY Object
const OTYPE_NOTSET = uint16(0x0000) // Object Type NOT SET
KNOWN TYPES
const OTYPE_ORG = uint16(0x0002) // ORGANIZATION Object
const OTYPE_OTHER = uint16(0x00FF) // OTHER Object Type
const OTYPE_QWORD_OFFSET = OTYPE_DWORD_OFFSET + DWORD_BITS // BIT OFFSET in QWORD (uint64)
const OTYPE_REQUEST = uint16(0x00FC) // REQUEST Object
const OTYPE_STORE = uint16(0x0003) // STORE Object
const OTYPE_USER = uint16(0x0001) // USER Object
const OTYPE_WORD_OFFSET_MASK = uint16(0x00FF) // OBJECT TYPE for GLOBAL ID
const QWORD_BITS = 64
BITS for VARIOUS SIZES
const SHARD_GROUP_BITS = 4 // NUMBER of Bits Used for SHARD GROUP
SHARD GROUP BIT MANAGEMENT
const SHARD_GROUP_DWORD_MASK = uint32(0xF0000000) // ID for SHARD GROUP
const SHARD_GROUP_DWORD_OFFSET = DWORD_BITS - SHARD_GROUP_BITS // BIT OFFSET in DWORD (uint32)
const SHARD_GROUP_DWORD_OFFSET_MASK = uint32(0x0000000F) // ID for SHARD GROUP
const SHARD_GROUP_QWORD_OFFSET = SHARD_GROUP_DWORD_OFFSET + DWORD_BITS // BIT OFFSET in QWORD (uint64)
const SHARD_GROUP_WORD_OFFSET_MASK = uint16(0x000F) // ID for SHARD GROUP
const SHARD_ID_BITS = 12 // NUMBER of Bits Used for SHARD ID
SHARD ID BIT MANAGEMENT
const SHARD_ID_DWORD_MASK = uint32(0x00000FFF) // ID of SHARD in GROUP
const SHARD_ID_DWORD_OFFSET = 0 // BIT OFFSET in DWORD (uint32)
const SHARD_ID_QWORD_OFFSET = SHARD_GROUP_DWORD_OFFSET + DWORD_BITS // BIT OFFSET in QWORD (uint64)
const SHARD_QWORD_MASK = uint64(0xF0000FFF00000000) // UPPER DWORD
SEPARATION of PARTS
const SHARD_QWORD_OFFSET = 32 // BIT OFFSERR in QWORD
const SYSTEM_ADMINISTRATOR = uint64(0x1000000000000) // STAR System Administrator
GLOBAL OBJECT CONSTANTS
const SYSTEM_ORGANIZATION = uint64(0x2000000000000) // Global Management Organization
const WORD_BITS = 16
Variables ¶
This section is empty.
Functions ¶
func ConfigProperty ¶
func ConfigPropertyFloat64 ¶
func ConfigPropertyINT ¶
func ConfigPropertyObject ¶
func ConfigPropertyString ¶
func ConfigPropertyUINT ¶
func IsObjectOfType ¶
func LocalIDFromID ¶
func ObjectTypeFromID ¶
func RandomShardID ¶
func RandomShardID() uint32
func ShardFromID ¶
func ShardGroupFromID ¶
func ShardInfoFromID ¶
func StringEmptyOnNil ¶
If nil String Pointer return Empty String (Allows Conversion Betwee String and String Pointer)
func StringNilOnEmpty ¶
GLOBAL HELPERs // If Empty String return nil (Allows Conversion Betwee String and String Pointer)
func UTCTimeStamp ¶
func UTCTimeStamp() string
UTCTimeStamp Return UTC Time Stamp String in RFC 3339
Types ¶
type DBConnection ¶
type DBConnection struct { Database string `json:"database"` User string `json:"user,omitempty"` Password string `json:"password,omitempty"` Server *Server `json:"server"` Options map[string]interface{} `json:"options,omitempty"` }
DEFINITION: Database Connection
func (*DBConnection) FromConfig ¶
func (s *DBConnection) FromConfig(base map[string]interface{}) error
type DBShard ¶
type DBShard struct { Range []uint32 `json:"range"` Connection DBConnection `json:"connection"` DBConnection *sql.DB }
DEFINITION: Database Shard
func (*DBShard) FromConfig ¶
type DBShardGroup ¶
type DBShardGroup struct {
Shards [](*DBShard) `json:"shards"`
}
DEFINITION: Database Shard Group
func (*DBShardGroup) FromConfig ¶
func (s *DBShardGroup) FromConfig(base map[string]interface{}) error
type ShardedDatabase ¶
type ShardedDatabase struct {
Groups [](*DBShardGroup) `json:"shard-groups"`
}
DEFINITION: Sharded Database Definition
func (*ShardedDatabase) FromConfig ¶
func (s *ShardedDatabase) FromConfig(base map[string]interface{}) error
type StoreSession ¶
type StoreSession struct {
// contains filtered or unexported fields
}
func ImportStoreSession ¶
func ImportStoreSession(i string, valid_for uint16) (*StoreSession, error)
func NewStoreSession ¶
func NewStoreSession(store uint64, key []byte, valid_for uint16) (*StoreSession, error)
func (*StoreSession) ExpireHex ¶
func (o *StoreSession) ExpireHex() string
func (*StoreSession) ExpireTime ¶
func (o *StoreSession) ExpireTime() *time.Time
func (*StoreSession) ExpireUnix ¶
func (o *StoreSession) ExpireUnix() int64
func (*StoreSession) Export ¶
func (o *StoreSession) Export() (string, error)
func (*StoreSession) Extend ¶
func (o *StoreSession) Extend(d uint16) int64
func (*StoreSession) ExtendBy ¶
func (o *StoreSession) ExtendBy() uint16
func (*StoreSession) Import ¶
func (o *StoreSession) Import(v string) error
func (*StoreSession) IsExpired ¶
func (o *StoreSession) IsExpired() bool
func (*StoreSession) IsValid ¶
func (o *StoreSession) IsValid() bool
func (*StoreSession) Key ¶
func (o *StoreSession) Key() []byte
func (*StoreSession) KeyHex ¶
func (o *StoreSession) KeyHex() string
func (*StoreSession) SetExtendBy ¶
func (o *StoreSession) SetExtendBy(by uint16) (uint16, error)
func (*StoreSession) Store ¶
func (o *StoreSession) Store() uint64
func (*StoreSession) StoreHex ¶
func (o *StoreSession) StoreHex() string