orm

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

cSpell:ignore gonic, orgs, paulo, ferreira

cSpell:ignore ferreira, paulo

cSpell:ignore ferreira, paulo

cSpell:ignore bson, paulo ferreira

cSpell:ignore bson, paulo ferreira

cSpell:ignore bson, paulo ferreira

cSpell:ignore bson, paulo ferreira

cSpell:ignore ferreira, paulo

cSpell:ignore bson, paulo ferreira

cSpell:ignore ferreira, paulo

cSpell:ignore ferreira, paulo

cSpell:ignore bson, paulo ferreira

cSpell:ignore ferreira, paulo

cSpell:ignore ferreira, paulo

cSpell:ignore bson, paulo ferreira

cSpell:ignore bson, paulo ferreira

cSpell:ignore bson, paulo ferreira

Index

Constants

View Source
const CATEGORY_ORG = 0x0200 // ORGANIZATION ROLES
View Source
const CATEGORY_STORE = 0x0300 // STORE ROLES
View Source
const CATEGORY_SYSTEM = 0x0100 // SYSTEM ROLES

Object: CATEGORIES //

View Source
const FUNCTION_ALL = 0xFFFF

FUNCTION GROUPS

View Source
const FUNCTION_CREATE = 0x0100
View Source
const FUNCTION_DELETE = 0x0400
View Source
const FUNCTION_LIST = 0x0002
View Source
const FUNCTION_MODIFY = 0xFF00
View Source
const FUNCTION_READ = 0x0001

FUNCTIONS

View Source
const FUNCTION_READONLY = 0x00FF
View Source
const FUNCTION_READ_LIST = 0x0003

COMBINED READ and LIST

View Source
const FUNCTION_UPDATE = 0x0200
View Source
const OBJECT_TYPE_FOLDER = 0

KNOWN OBJECT TYPES

View Source
const OBJECT_TYPE_JSON = 1
View Source
const STATE_BLOCKED = 0x0002 // User/Organization Blocked (USE: Administrator Blocked User Access)
View Source
const STATE_DELETE = 0x2000 // Object Marked for Deletion
View Source
const STATE_INACTIVE = 0x0001 // User Locked Out of System (USE: Too Many Failed Password Attempts)

FUNCTIONS

View Source
const STATE_MASK_FUNCTIONS = 0x0FFF // MASK LOWER BITS
View Source
const STATE_MASK_MARKERS = 0xF000 // MASK UPPER Bits

MASKS

View Source
const STATE_READONLY = 0x0004 // User/Organization Disabled All Modification Roles
View Source
const STATE_SYSTEM = 0x1000 // SYSTEM User/Organization

MARKERS

View Source
const SUBCATEGORY_CONF = 0x0001 // Configuration Management

Management: SUB-CATEGORIES //

View Source
const SUBCATEGORY_INVITE = 0x0004 // Invitation Management
View Source
const SUBCATEGORY_OBJECT = 0x0007 // Store Object Management
View Source
const SUBCATEGORY_ORG = 0x0005 // Organization Management
View Source
const SUBCATEGORY_ROLES = 0x0003 // Roles Management
View Source
const SUBCATEGORY_STORE = 0x0006 // Store Management
View Source
const SUBCATEGORY_TEMPLATE = 0x0008 // Template Management
View Source
const SUBCATEGORY_USER = 0x0002 // User Management

Variables

This section is empty.

Functions

func ClearStates

func ClearStates(state, clear uint16) uint16

func CountInvitations

func CountInvitations(db *sql.DB, q query.TQueryConditions) (uint64, error)

func CountRegisteredObjectInviteManagers added in v0.0.6

func CountRegisteredObjectInviteManagers(db *sql.DB, object uint64) (uint64, error)

func CountRegisteredObjectRoleManagers added in v0.0.6

func CountRegisteredObjectRoleManagers(db *sql.DB, object uint64) (uint64, error)

func CountRegisteredObjectTemplates

func CountRegisteredObjectTemplates(db *sql.DB, object uint64, q query.TQueryConditions) (uint64, error)

func CountRegisteredObjectUsers

func CountRegisteredObjectUsers(db *sql.DB, object uint64, q query.TQueryConditions) (uint64, error)

func CountRegisteredOrgStores

func CountRegisteredOrgStores(db *sql.DB, org uint64, q query.TQueryConditions) (uint64, error)

func CountRegisteredOrgs

func CountRegisteredOrgs(db *sql.DB, q query.TQueryConditions) (uint64, error)

func CountRegisteredUserObjects

func CountRegisteredUserObjects(db *sql.DB, user uint64, q query.TQueryConditions) (uint64, error)

func CountRegisteredUserObjectsByType

func CountRegisteredUserObjectsByType(db *sql.DB, user uint64, ltype uint16, q query.TQueryConditions) (uint64, error)

func CountRegisteredUsers

func CountRegisteredUsers(db *sql.DB, q query.TQueryConditions) (uint64, error)

func CountStoreObject

func CountStoreObject(db *sql.DB, store uint32, q query.TQueryConditions) (uint64, error)

func CountStoreParentObject

func CountStoreParentObject(db *sql.DB, store uint32, parent uint32, q query.TQueryConditions) (uint64, error)

func DeleteRegisteredObjectTemplate

func DeleteRegisteredObjectTemplate(db *sql.DB, object uint64, template string) error

func DeleteRegisteredObjectUser added in v0.0.6

func DeleteRegisteredObjectUser(db *sql.DB, object uint64, user uint64) (bool, error)

func DeleteRegisteredUserObject added in v0.0.6

func DeleteRegisteredUserObject(db *sql.DB, user uint64, object uint64) (bool, error)

func DeleteStoreObject

func DeleteStoreObject(db *sql.DB, store uint32, oid uint32) error

func DeleteStoreObjectFolder

func DeleteStoreObjectFolder(db *sql.DB, store uint32, folder uint32) error

func ExistsRegisteredObjectTemplate

func ExistsRegisteredObjectTemplate(db *sql.DB, object uint64, template string) (bool, error)

func GetShardInviteID added in v0.0.5

func GetShardInviteID(db sqlf.Executor, uid string) (uint32, error)

func GetShardObjectID added in v0.0.5

func GetShardObjectID(db sqlf.Executor, store uint32, title string) (uint32, error)

func GetShardOrgID added in v0.0.5

func GetShardOrgID(db sqlf.Executor, alias string) (uint32, error)

func GetShardStoreID added in v0.0.5

func GetShardStoreID(db sqlf.Executor, org uint64, alias string) (uint32, error)

func GetShardUserID added in v0.0.5

func GetShardUserID(db sqlf.Executor, email string) (uint32, error)

func HasAllStates

func HasAllStates(state, test uint16) bool

func HasAnyStates

func HasAnyStates(state, test uint16) bool

func HasPendingInvitation

func HasPendingInvitation(db *sql.DB, object uint64, invitee_email string) (bool, error)

func QueryInvitations

func QueryInvitations(db *sql.DB, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryRegisteredObjectTemplates

func QueryRegisteredObjectTemplates(db *sql.DB, object uint64, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryRegisteredObjectUsers

func QueryRegisteredObjectUsers(db *sql.DB, object uint64, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryRegisteredOrgs

func QueryRegisteredOrgs(db *sql.DB, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryRegisteredStores

func QueryRegisteredStores(db *sql.DB, org uint64, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryRegisteredUserObjects

func QueryRegisteredUserObjects(db *sql.DB, user uint64, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryRegisteredUserObjectsByType

func QueryRegisteredUserObjectsByType(db *sql.DB, user uint64, ltype uint16, q query.TQueryConditions, c bool) (query.TQueryResults, error)

TODO Implement Delete (Both From Within an Entry and Without a Structure)

func QueryRegisteredUsers

func QueryRegisteredUsers(db *sql.DB, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func QueryStoreParentObjects

func QueryStoreParentObjects(db *sql.DB, store uint32, parent uint32, q query.TQueryConditions, c bool) (query.TQueryResults, error)

func RandomAlphaNumericPunctuationString

func RandomAlphaNumericPunctuationString(n int) string

func RandomAlphaNumericString

func RandomAlphaNumericString(n int) string

func RandomAlphaString

func RandomAlphaString(n int) string

func Role

func Role(category, function uint16) uint32

func RoleAddFunctions

func RoleAddFunctions(functions uint32, role uint32) uint32

func RoleCategory

func RoleCategory(role uint32) uint16

func RoleExactMatch

func RoleExactMatch(from, to uint32) bool

func RoleFunctions

func RoleFunctions(role uint32) uint16

func RoleIsValid

func RoleIsValid(role uint32) bool

func RoleMatch

func RoleMatch(from, to uint32) bool

func RoleMatchCategory

func RoleMatchCategory(category uint16, role uint32) bool

func RoleMatchExactFunctions

func RoleMatchExactFunctions(from, to uint32) bool

func RoleMatchFunctions

func RoleMatchFunctions(from, to uint32) bool

func RoleMatchSubCategory added in v0.0.6

func RoleMatchSubCategory(subcategory uint16, role uint32) bool

func RoleRemoveFunctions

func RoleRemoveFunctions(functions, role uint32) uint32

func RoleSubCategory added in v0.0.6

func RoleSubCategory(role uint32) uint16

func SetStates

func SetStates(state, set uint16) uint16

Types

type DBSessionManager

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

func NewDBManager

func NewDBManager(c *common.ShardedDatabase) *DBSessionManager

Constructor Create an RPF Instance

func (*DBSessionManager) Connect

func (m *DBSessionManager) Connect(id uint64) (*sql.DB, error)

func (*DBSessionManager) ConnectTo

func (m *DBSessionManager) ConnectTo(g uint16, sID uint32) (*sql.DB, error)

type I_Roles

type I_Roles interface {
	Roles() []uint32
	IsRolesEmpty() bool
	HasRole(role uint32) bool
	HasExactRole(role uint32) bool
	GetCategoryRole(category uint16) uint32
	GetSubCategoryRole(subcategory uint16) uint32
	AddRole(role uint32) bool
	AddRoles(roles []uint32) bool
	RemoveRole(role uint32) bool
	RemoveCategory(category uint16) bool
	RemoveExactRole(role uint32) bool
	RemoveRoles(roles []uint32) bool
	RemoveAllRoles() bool
	RolesFromCSV(csv string) bool
	RolesToCSV() string
}

type Invitation

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

Invitation Object Definition

func (*Invitation) AddRole

func (o *Invitation) AddRole(role uint32) bool

func (*Invitation) AddRoles

func (o *Invitation) AddRoles(roles []uint32) bool

func (*Invitation) ByID

func (o *Invitation) ByID(db *sql.DB, id uint32) error

ByID Finds Entry By ID

func (*Invitation) Created

func (o *Invitation) Created() *time.Time

func (*Invitation) Creator

func (o *Invitation) Creator() uint64

func (*Invitation) Expiration

func (o *Invitation) Expiration() *time.Time

func (*Invitation) ExpirationUTC

func (o *Invitation) ExpirationUTC() string

func (*Invitation) Flush

func (o *Invitation) Flush(db sqlf.Executor, force bool) error

func (*Invitation) HasExactRole

func (o *Invitation) HasExactRole(role uint32) bool

func (*Invitation) HasRole

func (o *Invitation) HasRole(role uint32) bool

func (*Invitation) ID

func (o *Invitation) ID() uint32

ID Get User ID

func (*Invitation) InviteeEmail

func (o *Invitation) InviteeEmail() string

func (*Invitation) IsDirty

func (o *Invitation) IsDirty() bool

TODO Implement Delete (Both From Within an Entry and Without a Structure) IsDirty Have the Object Properties Changed since last Serialization?

func (*Invitation) IsNew

func (o *Invitation) IsNew() bool

func (*Invitation) IsRolesEmpty

func (o *Invitation) IsRolesEmpty() bool

func (*Invitation) IsValid

func (o *Invitation) IsValid() bool

func (*Invitation) Key

func (o *Invitation) Key() *uint64

func (*Invitation) KeyPick

func (o *Invitation) KeyPick() []byte

func (*Invitation) Message

func (o *Invitation) Message() string

func (*Invitation) Object

func (o *Invitation) Object() uint64

func (*Invitation) RemoveAllRoles

func (o *Invitation) RemoveAllRoles() bool

func (*Invitation) RemoveCategory

func (o *Invitation) RemoveCategory(category uint16) bool

func (*Invitation) RemoveExactRole

func (o *Invitation) RemoveExactRole(role uint32) bool

func (*Invitation) RemoveRole

func (o *Invitation) RemoveRole(role uint32) bool

func (*Invitation) RemoveRoles

func (o *Invitation) RemoveRoles(roles []uint32) bool

func (*Invitation) Roles

func (o *Invitation) Roles() []uint32

Implementation of I_Roles //

func (*Invitation) RolesFromCSV

func (o *Invitation) RolesFromCSV(csv string) bool

func (*Invitation) RolesToCSV

func (o *Invitation) RolesToCSV() string

func (*Invitation) SetCreator

func (o *Invitation) SetCreator(id uint64) (uint64, error)

func (*Invitation) SetExpiration

func (o *Invitation) SetExpiration(t time.Time) error

func (*Invitation) SetExpiresIn

func (o *Invitation) SetExpiresIn(days uint16) error

func (*Invitation) SetInviteeEmail

func (o *Invitation) SetInviteeEmail(email string) (string, error)

func (*Invitation) SetKey

func (o *Invitation) SetKey(id uint64, pick []byte) error

func (*Invitation) SetMessage

func (o *Invitation) SetMessage(m string) (string, error)

func (*Invitation) SetObject

func (o *Invitation) SetObject(id uint64) (uint64, error)

func (*Invitation) UID

func (o *Invitation) UID() string

type InvitationRegistry

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

Invitation Registry Object Definition

func InvitationToRegistry

func InvitationToRegistry(i *Invitation, group uint16, shard uint32) (*InvitationRegistry, error)

func (*InvitationRegistry) ByID

func (o *InvitationRegistry) ByID(db *sql.DB, id uint64) error

ByID Finds Entry By ID

func (*InvitationRegistry) ByUID

func (o *InvitationRegistry) ByUID(db *sql.DB, uid string) error

ByUID Finds Entry By Unique ID String

func (*InvitationRegistry) Creator

func (o *InvitationRegistry) Creator() uint64

func (*InvitationRegistry) Expiration

func (o *InvitationRegistry) Expiration() *time.Time

func (*InvitationRegistry) ExpirationUTC

func (o *InvitationRegistry) ExpirationUTC() string

func (*InvitationRegistry) Flush

func (o *InvitationRegistry) Flush(db sqlf.Executor, force bool) error

func (*InvitationRegistry) HasPending

func (o *InvitationRegistry) HasPending(db *sql.DB) (bool, error)

func (*InvitationRegistry) ID

func (o *InvitationRegistry) ID() uint64

func (*InvitationRegistry) InviteeEmail

func (o *InvitationRegistry) InviteeEmail() string

func (*InvitationRegistry) IsActive

func (o *InvitationRegistry) IsActive() bool

func (*InvitationRegistry) IsDirty

func (o *InvitationRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*InvitationRegistry) IsExpired

func (o *InvitationRegistry) IsExpired() bool

func (*InvitationRegistry) IsNew

func (o *InvitationRegistry) IsNew() bool

func (*InvitationRegistry) IsValid

func (o *InvitationRegistry) IsValid() bool

func (*InvitationRegistry) Object

func (o *InvitationRegistry) Object() uint64

func (*InvitationRegistry) SetAccepted

func (o *InvitationRegistry) SetAccepted() uint16

func (*InvitationRegistry) SetDeclined

func (o *InvitationRegistry) SetDeclined() uint16

func (*InvitationRegistry) SetExpiration

func (o *InvitationRegistry) SetExpiration(t time.Time) error

func (*InvitationRegistry) SetExpiresIn

func (o *InvitationRegistry) SetExpiresIn(days uint16) error

func (*InvitationRegistry) SetRevoked

func (o *InvitationRegistry) SetRevoked() uint16

func (*InvitationRegistry) SetState

func (o *InvitationRegistry) SetState(state uint16) error

func (*InvitationRegistry) State

func (o *InvitationRegistry) State() uint16

func (*InvitationRegistry) UID

func (o *InvitationRegistry) UID() string

type Key

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

Keys Object

func NewKey

func NewKey(creator uint64, bytes []byte, exp time.Time) ([]byte, *Key, error)

func (*Key) ByID

func (o *Key) ByID(db *sql.DB, id uint32) error

ByID Finds Store By ID

func (*Key) Created

func (o *Key) Created() *time.Time

func (*Key) Creator

func (o *Key) Creator() uint64

func (*Key) DecryptKey

func (o *Key) DecryptKey(key []byte) ([]byte, error)

func (*Key) EncryptKey

func (o *Key) EncryptKey(creator uint64, bytes []byte) ([]byte, error)

func (*Key) Expiration

func (o *Key) Expiration() *time.Time

func (*Key) ExpirationUTC

func (o *Key) ExpirationUTC() string

func (*Key) Flush

func (o *Key) Flush(db sqlf.Executor, force bool) error

func (*Key) ID

func (o *Key) ID() uint32

ID Local ID

func (*Key) IsDirty

func (o *Key) IsDirty() bool

func (*Key) IsNew

func (o *Key) IsNew() bool

func (*Key) IsValid

func (o *Key) IsValid() bool

func (*Key) SetExpiration

func (o *Key) SetExpiration(t time.Time) error

func (*Key) SetExpiresIn

func (o *Key) SetExpiresIn(days uint16) error

type ObjectTemplateRegistry

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

Object Template Registry Definition

func (*ObjectTemplateRegistry) ByTemplate

func (o *ObjectTemplateRegistry) ByTemplate(db *sql.DB, object uint64, template string) error

ByTemplate Find Template in Object by Name

func (*ObjectTemplateRegistry) Delete

func (o *ObjectTemplateRegistry) Delete(db *sql.DB, force bool) error

func (*ObjectTemplateRegistry) Flush

func (o *ObjectTemplateRegistry) Flush(db sqlf.Executor, force bool) error

func (*ObjectTemplateRegistry) IsDirty

func (o *ObjectTemplateRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*ObjectTemplateRegistry) IsNew

func (o *ObjectTemplateRegistry) IsNew() bool

func (*ObjectTemplateRegistry) IsSystemOrganization

func (o *ObjectTemplateRegistry) IsSystemOrganization() bool

func (*ObjectTemplateRegistry) IsValid

func (o *ObjectTemplateRegistry) IsValid() bool

func (*ObjectTemplateRegistry) Object

func (o *ObjectTemplateRegistry) Object() uint64

ID Get Organization ID

func (*ObjectTemplateRegistry) SetKey

func (o *ObjectTemplateRegistry) SetKey(object uint64, template string) error

func (*ObjectTemplateRegistry) SetTitle

func (o *ObjectTemplateRegistry) SetTitle(s string) (string, error)

func (*ObjectTemplateRegistry) Template

func (o *ObjectTemplateRegistry) Template() string

func (*ObjectTemplateRegistry) Title

func (o *ObjectTemplateRegistry) Title() string

type ObjectUserRegistry

type ObjectUserRegistry struct {
	States
	// contains filtered or unexported fields
}

Org User Registry Definition

func (*ObjectUserRegistry) AddRole

func (o *ObjectUserRegistry) AddRole(role uint32) bool

func (*ObjectUserRegistry) AddRoles

func (o *ObjectUserRegistry) AddRoles(roles []uint32) bool

func (*ObjectUserRegistry) ByKey

func (o *ObjectUserRegistry) ByKey(db *sql.DB, object uint64, user uint64) error

ByID Finds Entry By Org / User

func (*ObjectUserRegistry) ClearStates

func (o *ObjectUserRegistry) ClearStates(states uint16) (uint16, error)

func (*ObjectUserRegistry) CreateStoreKey

func (o *ObjectUserRegistry) CreateStoreKey(hexCypher string) error

func (*ObjectUserRegistry) Flush

func (o *ObjectUserRegistry) Flush(db sqlf.Executor, force bool) error

func (*ObjectUserRegistry) GetCategoryRole added in v0.0.6

func (o *ObjectUserRegistry) GetCategoryRole(category uint16) uint32

func (*ObjectUserRegistry) GetSubCategoryRole added in v0.0.6

func (o *ObjectUserRegistry) GetSubCategoryRole(subcategory uint16) uint32

func (*ObjectUserRegistry) HasExactRole

func (o *ObjectUserRegistry) HasExactRole(role uint32) bool

func (*ObjectUserRegistry) HasRole

func (o *ObjectUserRegistry) HasRole(role uint32) bool

func (*ObjectUserRegistry) IsAdminUser

func (o *ObjectUserRegistry) IsAdminUser() bool

func (*ObjectUserRegistry) IsBlocked

func (o *ObjectUserRegistry) IsBlocked() bool

State Management

func (*ObjectUserRegistry) IsDirty

func (o *ObjectUserRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*ObjectUserRegistry) IsInvitationManager added in v0.0.6

func (o *ObjectUserRegistry) IsInvitationManager() bool

func (*ObjectUserRegistry) IsNew

func (o *ObjectUserRegistry) IsNew() bool

func (*ObjectUserRegistry) IsReadOnly

func (o *ObjectUserRegistry) IsReadOnly() bool

func (*ObjectUserRegistry) IsRolesEmpty

func (o *ObjectUserRegistry) IsRolesEmpty() bool

func (*ObjectUserRegistry) IsRolesManager added in v0.0.6

func (o *ObjectUserRegistry) IsRolesManager() bool

func (*ObjectUserRegistry) IsSystemOrganization

func (o *ObjectUserRegistry) IsSystemOrganization() bool

func (*ObjectUserRegistry) IsValid

func (o *ObjectUserRegistry) IsValid() bool

func (*ObjectUserRegistry) Object

func (o *ObjectUserRegistry) Object() uint64

ID Get Organization ID

func (*ObjectUserRegistry) RemoveAllRoles

func (o *ObjectUserRegistry) RemoveAllRoles() bool

func (*ObjectUserRegistry) RemoveCategory

func (o *ObjectUserRegistry) RemoveCategory(category uint16) bool

func (*ObjectUserRegistry) RemoveExactRole

func (o *ObjectUserRegistry) RemoveExactRole(role uint32) bool

func (*ObjectUserRegistry) RemoveRole

func (o *ObjectUserRegistry) RemoveRole(role uint32) bool

func (*ObjectUserRegistry) RemoveRoles

func (o *ObjectUserRegistry) RemoveRoles(roles []uint32) bool

func (*ObjectUserRegistry) Roles

func (o *ObjectUserRegistry) Roles() []uint32

Implementation of I_Roles //

func (*ObjectUserRegistry) RolesFromCSV

func (o *ObjectUserRegistry) RolesFromCSV(csv string) bool

func (*ObjectUserRegistry) RolesToCSV

func (o *ObjectUserRegistry) RolesToCSV() string

func (*ObjectUserRegistry) SetKey

func (o *ObjectUserRegistry) SetKey(object uint64, user uint64) error

func (*ObjectUserRegistry) SetState

func (o *ObjectUserRegistry) SetState(states uint16) (uint16, error)

func (*ObjectUserRegistry) SetStoreKey

func (o *ObjectUserRegistry) SetStoreKey(hexCypher string, key []byte) error

func (*ObjectUserRegistry) SetUserName

func (o *ObjectUserRegistry) SetUserName(username string) (string, error)

func (*ObjectUserRegistry) State

func (o *ObjectUserRegistry) State() uint16

func (*ObjectUserRegistry) StoreKey

func (o *ObjectUserRegistry) StoreKey(hexCypher string) ([]byte, error)

STORE KEY

func (*ObjectUserRegistry) StoreKeyBytes

func (o *ObjectUserRegistry) StoreKeyBytes(key []byte) ([]byte, error)

func (*ObjectUserRegistry) User

func (o *ObjectUserRegistry) User() uint64

func (*ObjectUserRegistry) UserName

func (o *ObjectUserRegistry) UserName() string

type OrgRegistry

type OrgRegistry struct {
	States
	// contains filtered or unexported fields
}

User Object Definition

func (*OrgRegistry) Alias

func (o *OrgRegistry) Alias() string

func (*OrgRegistry) ByAlias

func (o *OrgRegistry) ByAlias(db *sql.DB, alias string) error

ByOrgName Finds Org By Alias

func (*OrgRegistry) ByID

func (o *OrgRegistry) ByID(db *sql.DB, id uint64) error

ByID Finds User By ID

func (*OrgRegistry) ClearStates

func (o *OrgRegistry) ClearStates(states uint16) (uint16, error)

func (*OrgRegistry) Find

func (o *OrgRegistry) Find(db *sql.DB, id interface{}) error

func (*OrgRegistry) Flush

func (o *OrgRegistry) Flush(db sqlf.Executor, force bool) error

func (*OrgRegistry) HasAllStates

func (o *OrgRegistry) HasAllStates(states uint16) bool

func (*OrgRegistry) HasAnyStates

func (o *OrgRegistry) HasAnyStates(states uint16) bool

func (*OrgRegistry) ID

func (o *OrgRegistry) ID() uint64

func (*OrgRegistry) IsActive

func (o *OrgRegistry) IsActive() bool

func (*OrgRegistry) IsBlocked

func (o *OrgRegistry) IsBlocked() bool

func (*OrgRegistry) IsDirty

func (o *OrgRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*OrgRegistry) IsNew

func (o *OrgRegistry) IsNew() bool

func (*OrgRegistry) IsReadOnly

func (o *OrgRegistry) IsReadOnly() bool

func (*OrgRegistry) IsSystem

func (o *OrgRegistry) IsSystem() bool

func (*OrgRegistry) IsValid

func (o *OrgRegistry) IsValid() bool

func (*OrgRegistry) Name

func (o *OrgRegistry) Name() string

func (*OrgRegistry) SetAlias

func (o *OrgRegistry) SetAlias(alias string) (string, error)

func (*OrgRegistry) SetID

func (o *OrgRegistry) SetID(id uint64) (uint64, error)

func (*OrgRegistry) SetName

func (o *OrgRegistry) SetName(name string) (string, error)

func (*OrgRegistry) SetStates

func (o *OrgRegistry) SetStates(states uint16) (uint16, error)

func (*OrgRegistry) State

func (o *OrgRegistry) State() uint16

type OrgStoreRegistry

type OrgStoreRegistry struct {
	States
	// contains filtered or unexported fields
}

Org Store Registry Definition

func (*OrgStoreRegistry) ByAlias

func (o *OrgStoreRegistry) ByAlias(db *sql.DB, org uint64, store string) error

ByAlias Find Store in Organization by Alias

func (*OrgStoreRegistry) ByID

func (o *OrgStoreRegistry) ByID(db *sql.DB, org uint64, store uint64) error

ByID Find Store in Organization by ID

func (*OrgStoreRegistry) ClearStates

func (o *OrgStoreRegistry) ClearStates(states uint16) (uint16, error)

func (*OrgStoreRegistry) Find

func (o *OrgStoreRegistry) Find(db *sql.DB, org uint64, id interface{}) error

General Find Store in Org

func (*OrgStoreRegistry) Flush

func (o *OrgStoreRegistry) Flush(db sqlf.Executor, force bool) error

func (*OrgStoreRegistry) HasAllStates

func (o *OrgStoreRegistry) HasAllStates(states uint16) bool

func (*OrgStoreRegistry) HasAnyStates

func (o *OrgStoreRegistry) HasAnyStates(states uint16) bool

func (*OrgStoreRegistry) IsBlocked

func (o *OrgStoreRegistry) IsBlocked() bool

func (*OrgStoreRegistry) IsDirty

func (o *OrgStoreRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*OrgStoreRegistry) IsNew

func (o *OrgStoreRegistry) IsNew() bool

func (*OrgStoreRegistry) IsReadOnly

func (o *OrgStoreRegistry) IsReadOnly() bool

func (*OrgStoreRegistry) IsValid

func (o *OrgStoreRegistry) IsValid() bool

func (*OrgStoreRegistry) Organization

func (o *OrgStoreRegistry) Organization() uint64

ID Get Organization ID

func (*OrgStoreRegistry) SetKey

func (o *OrgStoreRegistry) SetKey(org uint64, user uint64) error

func (*OrgStoreRegistry) SetStates

func (o *OrgStoreRegistry) SetStates(states uint16) (uint16, error)

func (*OrgStoreRegistry) SetStoreAlias

func (o *OrgStoreRegistry) SetStoreAlias(alias string) (string, error)

func (*OrgStoreRegistry) State

func (o *OrgStoreRegistry) State() uint16

func (*OrgStoreRegistry) Store

func (o *OrgStoreRegistry) Store() uint64

func (*OrgStoreRegistry) StoreAlias

func (o *OrgStoreRegistry) StoreAlias() string

type Organization

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

Organization Object Definition

func (*Organization) Alias

func (o *Organization) Alias() string

func (*Organization) ByAlias

func (o *Organization) ByAlias(db *sql.DB, alias string) error

ByOrgName Finds Organization By Name

func (*Organization) ByID

func (o *Organization) ByID(db *sql.DB, id uint32) error

ByID Finds User By ID

func (*Organization) Created

func (o *Organization) Created() *time.Time

func (*Organization) Creator

func (o *Organization) Creator() uint64

func (*Organization) Find

func (o *Organization) Find(db *sql.DB, id interface{}) error

func (*Organization) Flush

func (o *Organization) Flush(db sqlf.Executor, force bool) error

func (*Organization) ID

func (o *Organization) ID() uint32

ID Get User ID

func (*Organization) IsDirty

func (o *Organization) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*Organization) IsNew

func (o *Organization) IsNew() bool

func (*Organization) IsSystem

func (o *Organization) IsSystem() bool

func (*Organization) IsValid

func (o *Organization) IsValid() bool

func (*Organization) Modified

func (o *Organization) Modified() *time.Time

func (*Organization) Modifier

func (o *Organization) Modifier() *uint64

func (*Organization) Name

func (o *Organization) Name() string

func (*Organization) SetAlias

func (o *Organization) SetAlias(alias string) (string, error)

func (*Organization) SetCreator

func (o *Organization) SetCreator(id uint64) error

func (*Organization) SetID

func (o *Organization) SetID(id uint32) (uint32, error)

func (*Organization) SetModifier

func (o *Organization) SetModifier(id uint64) error

func (*Organization) SetName

func (o *Organization) SetName(name string) (string, error)

func (*Organization) UpdateRegistry

func (o *Organization) UpdateRegistry() bool

type S_Roles

type S_Roles struct {
	I_Roles
	// contains filtered or unexported fields
}

func (*S_Roles) AddRole

func (o *S_Roles) AddRole(role uint32) bool

func (*S_Roles) AddRoles

func (o *S_Roles) AddRoles(roles []uint32) bool

func (*S_Roles) GetCategoryRole added in v0.0.6

func (o *S_Roles) GetCategoryRole(category uint16) uint32

func (*S_Roles) GetSubCategoryRole added in v0.0.6

func (o *S_Roles) GetSubCategoryRole(subcategory uint16) uint32

func (*S_Roles) HasCategory added in v0.0.6

func (o *S_Roles) HasCategory(category uint16) bool

func (*S_Roles) HasExactRole

func (o *S_Roles) HasExactRole(role uint32) bool

func (*S_Roles) HasRole

func (o *S_Roles) HasRole(role uint32) bool

func (*S_Roles) HasSubCategory added in v0.0.6

func (o *S_Roles) HasSubCategory(subcategory uint16) bool

func (*S_Roles) IsRolesEmpty

func (o *S_Roles) IsRolesEmpty() bool

func (*S_Roles) RemoveAllRoles

func (o *S_Roles) RemoveAllRoles() bool

func (*S_Roles) RemoveCategory

func (o *S_Roles) RemoveCategory(category uint16) bool

func (*S_Roles) RemoveExactRole

func (o *S_Roles) RemoveExactRole(role uint32) bool

func (*S_Roles) RemoveRole

func (o *S_Roles) RemoveRole(role uint32) bool

func (*S_Roles) RemoveRoles

func (o *S_Roles) RemoveRoles(roles []uint32) bool

func (*S_Roles) Roles

func (o *S_Roles) Roles() []uint32

func (*S_Roles) RolesFromCSV

func (o *S_Roles) RolesFromCSV(csv string) bool

func (*S_Roles) RolesToCSV

func (o *S_Roles) RolesToCSV() string

type States

type States interface {
	State() uint16
	HasAnyStates(states uint16) bool
	HasAllStates(states uint16) bool
	SetStates(states uint16)
	ClearStates(states uint16)
}

type Store

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

Store Object Definition

func (*Store) Alias

func (o *Store) Alias() string

func (*Store) ByAlias

func (o *Store) ByAlias(db *sql.DB, alias string) error

ByOrgName Finds Store By Name

func (*Store) ByID

func (o *Store) ByID(db *sql.DB, id uint32) error

ByID Finds Store By ID

func (*Store) Created

func (o *Store) Created() *time.Time

func (*Store) Creator

func (o *Store) Creator() uint64

func (*Store) Find

func (o *Store) Find(db *sql.DB, id interface{}) error

func (*Store) Flush

func (o *Store) Flush(db sqlf.Executor, force bool) error

func (*Store) ID

func (o *Store) ID() uint32

ID Local ID

func (*Store) IsDirty

func (o *Store) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*Store) IsNew

func (o *Store) IsNew() bool

func (*Store) IsValid

func (o *Store) IsValid() bool

func (*Store) Modified

func (o *Store) Modified() *time.Time

func (*Store) Modifier

func (o *Store) Modifier() *uint64

func (*Store) Name

func (o *Store) Name() string

func (*Store) Organization

func (o *Store) Organization() uint64

ID Store Parent Organization

func (*Store) SetAlias

func (o *Store) SetAlias(alias string) (string, error)

func (*Store) SetCreator

func (o *Store) SetCreator(id uint64) error

func (*Store) SetID

func (o *Store) SetID(id uint32) (uint32, error)

func (*Store) SetModifier

func (o *Store) SetModifier(id uint64) error

func (*Store) SetName

func (o *Store) SetName(name string) (string, error)

func (*Store) SetOrganization

func (o *Store) SetOrganization(org uint64) (uint64, error)

func (*Store) UpdateRegistry

func (o *Store) UpdateRegistry() bool

type StoreObject

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

STORE Object Definition

func ChildObjectFromParent

func ChildObjectFromParent(p *StoreObject) (*StoreObject, error)

func QueryStoreObjects

func QueryStoreObjects(db *sql.DB, store uint32, query string) ([]StoreObject, error)

TODO Implement Delete (Both From Within an Entry and Without a Structure)

func (*StoreObject) ByID

func (o *StoreObject) ByID(db *sql.DB, id uint32) error

ByID Finds Entry By Object ID

func (*StoreObject) ByKey

func (o *StoreObject) ByKey(db *sql.DB, store uint32, id uint32) error

ByKey Finds Entry By Store / Object ID

func (*StoreObject) Created

func (o *StoreObject) Created() *time.Time

func (*StoreObject) Creator

func (o *StoreObject) Creator() uint64

func (*StoreObject) Flush

func (o *StoreObject) Flush(db sqlf.Executor, force bool) error

func (*StoreObject) ID

func (o *StoreObject) ID() uint32

func (*StoreObject) IsDirty

func (o *StoreObject) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*StoreObject) IsNew

func (o *StoreObject) IsNew() bool

func (*StoreObject) Modified

func (o *StoreObject) Modified() *time.Time

func (*StoreObject) Modifier

func (o *StoreObject) Modifier() *uint64

func (*StoreObject) Object

func (o *StoreObject) Object() []byte

func (*StoreObject) Parent

func (o *StoreObject) Parent() uint32

func (*StoreObject) SetCreator

func (o *StoreObject) SetCreator(id uint64) error

func (*StoreObject) SetModifier

func (o *StoreObject) SetModifier(id uint64) error

func (*StoreObject) SetObject

func (o *StoreObject) SetObject(ob []byte) error

func (*StoreObject) SetParent

func (o *StoreObject) SetParent(p uint32) (uint32, error)

func (*StoreObject) SetStore

func (o *StoreObject) SetStore(s uint32) (uint32, error)

func (*StoreObject) SetTitle

func (o *StoreObject) SetTitle(t string) (string, error)

func (*StoreObject) SetType

func (o *StoreObject) SetType(t uint8) (uint8, error)

func (*StoreObject) Store

func (o *StoreObject) Store() uint32

func (*StoreObject) Title

func (o *StoreObject) Title() string

func (*StoreObject) Type

func (o *StoreObject) Type() uint8

type StoreTemplateObject

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

Templated Object for Storage

func (*StoreTemplateObject) DecryptObject

func (o *StoreTemplateObject) DecryptObject(key []byte, cbs []byte) error

func (*StoreTemplateObject) EncryptObject

func (o *StoreTemplateObject) EncryptObject(key []byte) ([]byte, error)

func (*StoreTemplateObject) FromString

func (o *StoreTemplateObject) FromString(s string) error

func (*StoreTemplateObject) MarshalJSON

func (o *StoreTemplateObject) MarshalJSON() ([]byte, error)

func (*StoreTemplateObject) SetTemplate

func (o *StoreTemplateObject) SetTemplate(v string) (string, error)

func (*StoreTemplateObject) SetTitle

func (o *StoreTemplateObject) SetTitle(v string) (string, error)

func (*StoreTemplateObject) SetValues

func (o *StoreTemplateObject) SetValues(v map[string]interface{}) (interface{}, error)

func (*StoreTemplateObject) SetVersion

func (o *StoreTemplateObject) SetVersion(v uint16) (uint16, error)

func (*StoreTemplateObject) Template

func (o *StoreTemplateObject) Template() string

func (*StoreTemplateObject) Title

func (o *StoreTemplateObject) Title() string

func (*StoreTemplateObject) ToString

func (o *StoreTemplateObject) ToString() (string, error)

func (*StoreTemplateObject) UnmarshalJSON

func (o *StoreTemplateObject) UnmarshalJSON(b []byte) error

func (*StoreTemplateObject) Values

func (o *StoreTemplateObject) Values() interface{}

func (*StoreTemplateObject) Version

func (o *StoreTemplateObject) Version() uint16

type Template

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

Template Object Definition

func (*Template) ByID

func (o *Template) ByID(db *sql.DB, id uint32) error

ByID Finds Template By ID

func (*Template) ByNameLatest

func (o *Template) ByNameLatest(db *sql.DB, name string) error

Finds Latest Version ofTemplate By Name

func (*Template) ByNameVersion

func (o *Template) ByNameVersion(db *sql.DB, name string, version uint16) error

Finds Template By Name and Version

func (*Template) Created

func (o *Template) Created() *time.Time

func (*Template) Description

func (o *Template) Description() string

func (*Template) Flush

func (o *Template) Flush(db sqlf.Executor, force bool) error

func (*Template) ID

func (o *Template) ID() uint32

ID Local ID

func (*Template) IsDirty

func (o *Template) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*Template) IsNew

func (o *Template) IsNew() bool

func (*Template) IsValid

func (o *Template) IsValid() bool

func (*Template) Model

func (o *Template) Model() string

func (*Template) ModelJSON

func (o *Template) ModelJSON() (map[string]interface{}, error)

func (*Template) SetDescription

func (o *Template) SetDescription(s string) (string, error)

func (*Template) SetID

func (o *Template) SetID(id uint32) (uint32, error)

func (*Template) SetModel

func (o *Template) SetModel(s string) (string, error)

func (*Template) SetTemplate

func (o *Template) SetTemplate(name string, version uint16) error

func (*Template) SetTitle

func (o *Template) SetTitle(s string) (string, error)

func (*Template) Template

func (o *Template) Template() string

func (*Template) Title

func (o *Template) Title() string

func (*Template) Version

func (o *Template) Version() uint16

type User

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

User Profile

func (*User) ByEmail

func (o *User) ByEmail(db *sql.DB, email string) error

ByEmail Finds User By Email

func (*User) ByID

func (o *User) ByID(db *sql.DB, id uint32) error

ByID Finds User By ID

func (*User) ByUserName

func (o *User) ByUserName(db *sql.DB, username string) error

ByUserName Finds User By User Name

func (*User) Created

func (o *User) Created() *time.Time

func (*User) Creator

func (o *User) Creator() uint64

func (*User) Email

func (o *User) Email() string

func (*User) Find

func (o *User) Find(db *sql.DB, id interface{}) error

func (*User) Flush

func (o *User) Flush(db sqlf.Executor, force bool) error

func (*User) ID

func (o *User) ID() uint32

ID Get User ID

func (*User) IsDirty

func (o *User) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*User) IsNew

func (o *User) IsNew() bool

func (*User) IsValid

func (o *User) IsValid() bool

func (*User) Modified

func (o *User) Modified() *time.Time

func (*User) Modifier

func (o *User) Modifier() *uint64

func (*User) Name

func (o *User) Name() string

func (*User) ResetHash

func (o *User) ResetHash(hash string) error

func (*User) SetCreator

func (o *User) SetCreator(id uint64) error

func (*User) SetEmail

func (o *User) SetEmail(email string) (string, error)

func (*User) SetHash

func (o *User) SetHash(hash string) error

func (*User) SetID

func (o *User) SetID(id uint32) (uint32, error)

func (*User) SetModifier

func (o *User) SetModifier(id uint64) error

func (*User) SetName

func (o *User) SetName(name string) (string, error)

func (*User) SetUserName

func (o *User) SetUserName(username string) (string, error)

func (*User) TestHash

func (o *User) TestHash(hash string) bool

func (*User) TestPassword

func (o *User) TestPassword(password string) bool

func (*User) UpdateHash

func (o *User) UpdateHash(old, hash string) error

func (*User) UpdateRegistry

func (o *User) UpdateRegistry() bool

func (*User) UserName

func (o *User) UserName() string

type UserObjectRegistry

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

User <--> Container Registry Definition

func (*UserObjectRegistry) Alias

func (o *UserObjectRegistry) Alias() string

func (*UserObjectRegistry) ByKey

func (o *UserObjectRegistry) ByKey(db *sql.DB, user uint64, object uint64) error

ByID Finds Entry By User / Org

func (*UserObjectRegistry) Favorite

func (o *UserObjectRegistry) Favorite() bool

func (*UserObjectRegistry) Flush

func (o *UserObjectRegistry) Flush(db sqlf.Executor, force bool) error

func (*UserObjectRegistry) IsDirty

func (o *UserObjectRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*UserObjectRegistry) IsNew

func (o *UserObjectRegistry) IsNew() bool

func (*UserObjectRegistry) IsSystemOrganization

func (o *UserObjectRegistry) IsSystemOrganization() bool

func (*UserObjectRegistry) IsValid

func (o *UserObjectRegistry) IsValid() bool

func (*UserObjectRegistry) Object

func (o *UserObjectRegistry) Object() uint64

func (*UserObjectRegistry) SetAlias

func (o *UserObjectRegistry) SetAlias(alias string) (string, error)

func (*UserObjectRegistry) SetFavorite

func (o *UserObjectRegistry) SetFavorite(f bool) (bool, error)

func (*UserObjectRegistry) SetKey

func (o *UserObjectRegistry) SetKey(user uint64, object uint64) error

func (*UserObjectRegistry) Type

func (o *UserObjectRegistry) Type() uint16

func (*UserObjectRegistry) User

func (o *UserObjectRegistry) User() uint64

ID Get Organization ID

type UserRegistry

type UserRegistry struct {
	States
	// contains filtered or unexported fields
}

User Object Definition

func UserRegistryFromUser

func UserRegistryFromUser(u *User) (*UserRegistry, error)

func (*UserRegistry) ByEmail

func (o *UserRegistry) ByEmail(db *sql.DB, email string) error

ByEmail Finds User By Email

func (*UserRegistry) ByID

func (o *UserRegistry) ByID(db *sql.DB, id uint64) error

ByID Finds User By ID

func (*UserRegistry) ByUserName

func (o *UserRegistry) ByUserName(db *sql.DB, username string) error

ByUserName Finds User By User Name

func (*UserRegistry) ClearStates

func (o *UserRegistry) ClearStates(states uint16)

func (*UserRegistry) Email

func (o *UserRegistry) Email() string

func (*UserRegistry) Find

func (o *UserRegistry) Find(db *sql.DB, id interface{}) error

func (*UserRegistry) Flush

func (o *UserRegistry) Flush(db sqlf.Executor, force bool) error

func (*UserRegistry) HasAllStates

func (o *UserRegistry) HasAllStates(states uint16) bool

func (*UserRegistry) HasAnyStates

func (o *UserRegistry) HasAnyStates(states uint16) bool

func (*UserRegistry) ID

func (o *UserRegistry) ID() uint64

ID Get User ID

func (*UserRegistry) IsActive

func (o *UserRegistry) IsActive() bool

func (*UserRegistry) IsBlocked

func (o *UserRegistry) IsBlocked() bool

func (*UserRegistry) IsDirty

func (o *UserRegistry) IsDirty() bool

IsDirty Have the Object Properties Changed since last Serialization?

func (*UserRegistry) IsNew

func (o *UserRegistry) IsNew() bool

func (*UserRegistry) IsReadOnly

func (o *UserRegistry) IsReadOnly() bool

func (*UserRegistry) IsValid

func (o *UserRegistry) IsValid() bool

func (*UserRegistry) Name

func (o *UserRegistry) Name() string

func (*UserRegistry) SetEmail

func (o *UserRegistry) SetEmail(email string) (string, error)

func (*UserRegistry) SetID

func (o *UserRegistry) SetID(id uint64) (uint64, error)

func (*UserRegistry) SetName

func (o *UserRegistry) SetName(name string) (string, error)

func (*UserRegistry) SetStates

func (o *UserRegistry) SetStates(states uint16)

func (*UserRegistry) SetUserName

func (o *UserRegistry) SetUserName(username string) (string, error)

func (*UserRegistry) State

func (o *UserRegistry) State() uint16

func (*UserRegistry) TestHash

func (o *UserRegistry) TestHash(hash string) bool

func (*UserRegistry) TestPassword

func (o *UserRegistry) TestPassword(password string) bool

func (*UserRegistry) UpdatePassword added in v0.0.2

func (o *UserRegistry) UpdatePassword(u *User) error

func (*UserRegistry) UpdateRegistry

func (o *UserRegistry) UpdateRegistry(u *User) error

func (*UserRegistry) UserName

func (o *UserRegistry) UserName() string

Directories

Path Synopsis
cSpell:ignore ferreira, paulo
cSpell:ignore ferreira, paulo
cSpell:ignore ferreira, paulo
cSpell:ignore ferreira, paulo

Jump to

Keyboard shortcuts

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