types

package
v0.20.8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHash string = `0`

Variables

View Source
var ID = id{}

Functions

func BoolToByte

func BoolToByte(b bool) []byte

func ByteToInt32

func ByteToInt32(b []byte) int32

func Int32ToByte

func Int32ToByte(i int32) []byte

func Int32ToStr

func Int32ToStr(i int32) string

func Int64ToByte

func Int64ToByte(i int64) []byte

func IsDefaultHash

func IsDefaultHash(h string) bool

func ObjectTypesNamePath

func ObjectTypesNamePath() []string

func ObjectTypesPath

func ObjectTypesPath() []string

func ObjectsKeyPath

func ObjectsKeyPath() []string

func ObjectsPath

func ObjectsPath() []string

func PermissionsNamePath

func PermissionsNamePath() []string

func PermissionsPath

func PermissionsPath() []string

func RelationTypesNamePath

func RelationTypesNamePath() []string

func RelationTypesPath

func RelationTypesPath() []string

func RelationsObjPath

func RelationsObjPath() []string

func RelationsSubPath

func RelationsSubPath() []string

func StrToInt32

func StrToInt32(s string) int32

func UUIDToByte

func UUIDToByte(s string) []byte

func Uint32ToByte

func Uint32ToByte(i uint32) []byte

func Uint64ToByte

func Uint64ToByte(i uint64) []byte

Types

type CheckResult

type CheckResult struct {
	Check bool
	Trace []string
}

type Object

type Object struct {
	*dsc.Object
}

func NewObject

func NewObject(i *dsc.Object) *Object

func (*Object) GetHash

func (i *Object) GetHash() (string, error)

func (*Object) Msg

func (i *Object) Msg() *dsc.Object

func (*Object) Normalize

func (i *Object) Normalize() error

func (*Object) PreValidate

func (i *Object) PreValidate() (bool, error)

func (*Object) String

func (i *Object) String() string

func (*Object) Validate

func (i *Object) Validate() (bool, error)

type ObjectDependencies

type ObjectDependencies []*ObjectDependency

type ObjectDependency

type ObjectDependency struct {
	*dsc.ObjectDependency
}

type ObjectIdentifier

type ObjectIdentifier struct {
	*dsc.ObjectIdentifier
}

func NewObjectIdentifier

func NewObjectIdentifier(i *dsc.ObjectIdentifier) *ObjectIdentifier

func (*ObjectIdentifier) Key

func (i *ObjectIdentifier) Key() string

func (*ObjectIdentifier) Msg

func (*ObjectIdentifier) Resolve

func (*ObjectIdentifier) Validate

func (i *ObjectIdentifier) Validate() (bool, error)

type ObjectType

type ObjectType struct {
	*dsc.ObjectType
}

func NewObjectType

func NewObjectType(i *dsc.ObjectType) *ObjectType

func (*ObjectType) GetHash

func (i *ObjectType) GetHash() (string, error)

func (*ObjectType) Msg

func (i *ObjectType) Msg() *dsc.ObjectType

func (*ObjectType) Normalize

func (i *ObjectType) Normalize() error

func (*ObjectType) PreValidate

func (i *ObjectType) PreValidate() (bool, error)

func (*ObjectType) Validate

func (i *ObjectType) Validate() (bool, error)

type ObjectTypeIdentifier

type ObjectTypeIdentifier struct {
	*dsc.ObjectTypeIdentifier
}

func (*ObjectTypeIdentifier) Msg

func (*ObjectTypeIdentifier) Resolve

func (*ObjectTypeIdentifier) Validate

func (i *ObjectTypeIdentifier) Validate() (bool, error)

type Objects

type Objects []*Object

func (*Objects) Msg

func (o *Objects) Msg() []*dsc.Object

type PaginationRequest

type PaginationRequest struct {
	*dsc.PaginationRequest
}

func NewPaginationRequest

func NewPaginationRequest(i *dsc.PaginationRequest) *PaginationRequest

type PaginationResponse

type PaginationResponse struct {
	*dsc.PaginationResponse
}

type Permission

type Permission struct {
	*dsc.Permission
}

func NewPermission

func NewPermission(i *dsc.Permission) *Permission

func (*Permission) GetHash

func (i *Permission) GetHash() (string, error)

func (*Permission) Msg

func (i *Permission) Msg() *dsc.Permission

func (*Permission) Normalize

func (i *Permission) Normalize() error

func (*Permission) PreValidate

func (i *Permission) PreValidate() (bool, error)

func (*Permission) Validate

func (i *Permission) Validate() (bool, error)

type PermissionIdentifier

type PermissionIdentifier struct {
	*dsc.PermissionIdentifier
}

func (*PermissionIdentifier) Msg

func (*PermissionIdentifier) Resolve

func (*PermissionIdentifier) Validate

func (i *PermissionIdentifier) Validate() (bool, error)

type Relation

type Relation struct {
	*dsc.Relation
}

func NewRelation

func NewRelation(i *dsc.Relation) *Relation

func (*Relation) GetHash

func (i *Relation) GetHash() (string, error)

func (*Relation) Key

func (i *Relation) Key() string

func (*Relation) Msg

func (i *Relation) Msg() *dsc.Relation

func (*Relation) Normalize

func (i *Relation) Normalize() error

func (*Relation) ObjectKey

func (i *Relation) ObjectKey() string

func (*Relation) SubjectKey

func (i *Relation) SubjectKey() string

func (*Relation) Validate

func (i *Relation) Validate() (bool, error)

type RelationIdentifier

type RelationIdentifier struct {
	*dsc.RelationIdentifier
}

func NewRelationIdentifier

func NewRelationIdentifier(i *dsc.RelationIdentifier) *RelationIdentifier

func (*RelationIdentifier) Msg

func (*RelationIdentifier) ObjKey

func (i *RelationIdentifier) ObjKey() string

func (*RelationIdentifier) Resolve

func (*RelationIdentifier) SubKey

func (i *RelationIdentifier) SubKey() string

func (*RelationIdentifier) Validate

func (i *RelationIdentifier) Validate() (bool, error)

type RelationType

type RelationType struct {
	*dsc.RelationType
}

func NewRelationType

func NewRelationType(i *dsc.RelationType) *RelationType

func (*RelationType) GetHash

func (i *RelationType) GetHash() (string, error)

func (*RelationType) Key

func (i *RelationType) Key() string

func (*RelationType) Msg

func (i *RelationType) Msg() *dsc.RelationType

func (*RelationType) Normalize

func (i *RelationType) Normalize() error

func (*RelationType) PreValidate

func (i *RelationType) PreValidate() (bool, error)

func (*RelationType) Validate

func (i *RelationType) Validate() (bool, error)

type RelationTypeIdentifier

type RelationTypeIdentifier struct {
	*dsc.RelationTypeIdentifier
}

func (*RelationTypeIdentifier) Key

func (i *RelationTypeIdentifier) Key() string

func (*RelationTypeIdentifier) Msg

func (*RelationTypeIdentifier) Resolve

func (*RelationTypeIdentifier) Validate

func (i *RelationTypeIdentifier) Validate() (bool, error)

type StatusFlag

type StatusFlag uint32
const (
	Default  StatusFlag = 0
	Hidden   StatusFlag = 1 << dsc.Flag_FLAG_HIDDEN
	ReadOnly StatusFlag = 1 << dsc.Flag_FLAG_READONLY
	System   StatusFlag = 1 << dsc.Flag_FLAG_SYSTEM
	Shadow   StatusFlag = 1 << dsc.Flag_FLAG_SHADOW
)

func Status

func Status(i uint32) StatusFlag

func (StatusFlag) Validate

func (f StatusFlag) Validate() bool

type StoreContext

type StoreContext struct {
	Context context.Context
	Store   *boltdb.BoltDB
	Opts    []boltdb.Opts
}

func (*StoreContext) CheckPermission

func (sc *StoreContext) CheckPermission(req *dsr.CheckPermissionRequest) (*CheckResult, error)

func (*StoreContext) CheckRelation

func (sc *StoreContext) CheckRelation(req *dsr.CheckRelationRequest) (*CheckResult, error)

func (*StoreContext) DeleteObject

func (sc *StoreContext) DeleteObject(objIdentifier *ObjectIdentifier) error

func (*StoreContext) DeleteObjectType

func (sc *StoreContext) DeleteObjectType(objTypeIdentifier *ObjectTypeIdentifier) error

func (*StoreContext) DeletePermission

func (sc *StoreContext) DeletePermission(permissionIdentifier *PermissionIdentifier) error

func (*StoreContext) DeleteRelation

func (sc *StoreContext) DeleteRelation(relIdentifier *RelationIdentifier) error

func (*StoreContext) DeleteRelationType

func (sc *StoreContext) DeleteRelationType(relTypeIdentifier *RelationTypeIdentifier) error

func (*StoreContext) GetGraph

func (*StoreContext) GetObject

func (sc *StoreContext) GetObject(objIdentifier *ObjectIdentifier) (*Object, error)

func (*StoreContext) GetObjectID

func (sc *StoreContext) GetObjectID(objIdentifier *ObjectIdentifier) (string, error)

func (*StoreContext) GetObjectMany

func (sc *StoreContext) GetObjectMany(objIdentifiers []*ObjectIdentifier) (Objects, error)

func (*StoreContext) GetObjectType

func (sc *StoreContext) GetObjectType(objTypeIdentifier *ObjectTypeIdentifier) (*ObjectType, error)

func (*StoreContext) GetObjectTypeID

func (sc *StoreContext) GetObjectTypeID(objTypeIdentifier *ObjectTypeIdentifier) (int32, error)

func (*StoreContext) GetObjectTypeName

func (sc *StoreContext) GetObjectTypeName(objTypeIdentifier *ObjectTypeIdentifier) (string, error)

func (*StoreContext) GetObjectTypes

func (sc *StoreContext) GetObjectTypes(page *PaginationRequest) ([]*ObjectType, *PaginationResponse, error)

func (*StoreContext) GetObjects

func (*StoreContext) GetPermission

func (sc *StoreContext) GetPermission(permissionIdentifier *PermissionIdentifier) (*Permission, error)

func (*StoreContext) GetPermissionID

func (sc *StoreContext) GetPermissionID(permissionIdentifier *PermissionIdentifier) (string, error)

func (*StoreContext) GetPermissionName

func (sc *StoreContext) GetPermissionName(permissionIdentifier *PermissionIdentifier) (string, error)

func (*StoreContext) GetPermissions

func (sc *StoreContext) GetPermissions(page *PaginationRequest) ([]*Permission, *PaginationResponse, error)

func (*StoreContext) GetRelation

func (sc *StoreContext) GetRelation(relationIdentifier *RelationIdentifier) ([]*Relation, error)

nolint: gocyclo

func (*StoreContext) GetRelationType

func (sc *StoreContext) GetRelationType(relTypeIdentifier *RelationTypeIdentifier) (*RelationType, error)

func (*StoreContext) GetRelationTypeID

func (sc *StoreContext) GetRelationTypeID(relTypeIdentifier *RelationTypeIdentifier) (int32, error)

func (*StoreContext) GetRelationTypeName

func (sc *StoreContext) GetRelationTypeName(relTypeIdentifier *RelationTypeIdentifier) (string, error)

func (*StoreContext) GetRelationTypes

func (sc *StoreContext) GetRelationTypes(param *ObjectTypeIdentifier, page *PaginationRequest) ([]*RelationType, *PaginationResponse, error)

func (*StoreContext) GetRelations

func (sc *StoreContext) GetRelations(param *RelationIdentifier, page *PaginationRequest) ([]*Relation, *PaginationResponse, error)

func (*StoreContext) SetObject

func (sc *StoreContext) SetObject(obj *Object) (*Object, error)

func (*StoreContext) SetObjectType

func (sc *StoreContext) SetObjectType(objType *ObjectType) (*ObjectType, error)

func (*StoreContext) SetPermission

func (sc *StoreContext) SetPermission(permission *Permission) (*Permission, error)

func (*StoreContext) SetRelation

func (sc *StoreContext) SetRelation(rel *Relation) (*Relation, error)

func (*StoreContext) SetRelationType

func (sc *StoreContext) SetRelationType(relType *RelationType) (*RelationType, error)

Jump to

Keyboard shortcuts

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