ds

package
v0.33.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeIDSeparator   byte = ':'
	InstanceSeparator byte = '|'
	RelationSeparator byte = '#'
)
View Source
const DefaultHash string = `0`

Variables

View Source
var (
	ErrObjectNotFound                    = cerr.NewAsertoError("E20031", codes.NotFound, http.StatusNotFound, "object not found")
	ErrRelationNotFound                  = cerr.NewAsertoError("E20032", codes.NotFound, http.StatusNotFound, "relation not found")
	ErrPermissionNotFound                = cerr.NewAsertoError("E20033", codes.NotFound, http.StatusNotFound, "permission not found")
	ErrInvalidRequest                    = cerr.NewAsertoError("E20040", codes.InvalidArgument, http.StatusBadRequest, "invalid request instance")
	ErrInvalidArgumentObject             = cerr.NewAsertoError("E20041", codes.InvalidArgument, http.StatusBadRequest, "object invalid argument")
	ErrInvalidArgumentRelation           = cerr.NewAsertoError("E20042", codes.InvalidArgument, http.StatusBadRequest, "relation invalid argument")
	ErrInvalidArgumentObjectIdentifier   = cerr.NewAsertoError("E20043", codes.InvalidArgument, http.StatusBadRequest, "object identifier invalid argument")
	ErrInvalidArgumentRelationIdentifier = cerr.NewAsertoError("E20044", codes.InvalidArgument, http.StatusBadRequest, "relation identifier invalid argument")
	ErrInvalidArgumentObjectTypeSelector = cerr.NewAsertoError("E20045", codes.InvalidArgument, http.StatusBadRequest, "object type selector invalid argument")
	ErrNoCompleteObjectIdentifier        = cerr.NewAsertoError("E20050", codes.FailedPrecondition, http.StatusPreconditionFailed, "relation identifier no complete object identifier")
	ErrGraphDirectionality               = cerr.NewAsertoError("E20051", codes.InvalidArgument, http.StatusPreconditionFailed, "unable to determine graph directionality")
)

Functions

func BoolToByte

func BoolToByte(b bool) []byte

func ByteToInt32

func ByteToInt32(b []byte) int32

func CalculateStats added in v0.31.0

func CalculateStats(ctx context.Context, tx *bolt.Tx) (*stats.Stats, error)

CalculateStats returns a Stats object with the counts of all objects and relations.

func Check added in v0.30.0

func Check(i *dsr3.CheckRequest) *check

func CheckPermission

func CheckPermission(i *dsr3.CheckPermissionRequest) *checkPermission

func CheckRelation

func CheckRelation(i *dsr3.CheckRelationRequest) *checkRelation

func Checks added in v0.33.0

func Checks(i *dsr3.ChecksRequest) *checks

func GetGraph

func GetGraph(i *dsr3.GetGraphRequest) *getGraph

func GetRelation added in v0.30.0

func GetRelation(i *dsr3.GetRelationRequest) *relations

func GetRelations added in v0.30.0

func GetRelations(i *dsr3.GetRelationsRequest) *relations

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 IsNotSet

func IsNotSet(s string) bool

func IsSet

func IsSet(s string) bool

func Manifest added in v0.30.0

func Manifest(metadata *dsm3.Metadata) *manifest

func NewRelationIdentifierBuf added in v0.33.3

func NewRelationIdentifierBuf() *bytes.Buffer

func Object

func Object(i *dsc3.Object) *object

func ObjectIdentifier

func ObjectIdentifier(i *dsc3.ObjectIdentifier) *objectIdentifier

func Relation

func Relation(i *dsc3.Relation) *relation

func RelationIdentifier

func RelationIdentifier(i *dsc3.RelationIdentifier) *relation

func RelationIdentifierBuffer added in v0.33.3

func RelationIdentifierBuffer() *bytes.Buffer

func ReturnRelationIdentifierBuffer added in v0.33.3

func ReturnRelationIdentifierBuffer(b *bytes.Buffer)

func SetContextWithReason added in v0.33.0

func SetContextWithReason(err error) *structpb.Struct

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

func UpdateMetadataObject added in v0.33.1

func UpdateMetadataObject(ctx context.Context, tx *bolt.Tx, path []string, keyFilter []byte, msg *dsc3.Object) (*dsc3.Object, error)

func UpdateMetadataRelation added in v0.33.1

func UpdateMetadataRelation(ctx context.Context, tx *bolt.Tx, path []string, key []byte, msg *dsc3.Relation) (*dsc3.Relation, error)

Types

type Stats added in v0.31.0

type Stats struct {
	*stats.Stats
}

Wraps the azm Stats object and adds mutator methods.

func NewStats added in v0.31.0

func NewStats() *Stats

func (*Stats) CountObjects added in v0.31.0

func (s *Stats) CountObjects(ctx context.Context, tx *bolt.Tx) error

func (*Stats) CountRelations added in v0.31.0

func (s *Stats) CountRelations(ctx context.Context, tx *bolt.Tx) error

relation stats.

Jump to

Keyboard shortcuts

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