ds

package
v0.33.30 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

func Check(i *dsr.CheckRequest) *check

func Checks

func Checks(i *dsr.ChecksRequest) *checks

func GetGraph

func GetGraph(i *dsr.GetGraphRequest) *getGraph

func GetRelation

func GetRelation(i *dsr.GetRelationRequest) *relations

func GetRelations

func GetRelations(i *dsr.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

func Manifest(metadata *dsm.Metadata) *manifest

func NewRelationIdentifierBuf

func NewRelationIdentifierBuf() *bytes.Buffer

func Object

func Object(i *dsc.Object) *object

func ObjectIdentifier

func ObjectIdentifier(i *dsc.ObjectIdentifier) *objectIdentifier

func PatchObjectRead added in v0.33.13

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

PatchObjectRead: transfers Objects.Properties["display_name"] to Object.DisplayName (BACKWARD COMPATIBILITY).

func PatchObjectWrite added in v0.33.13

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

PatchObjectWrite: transfers Object.DisplayName to Objects.Properties["display_name"] (FORWARD COMPATIBILITY).

func Relation

func Relation(i *dsc.Relation) *relation

func RelationIdentifier

func RelationIdentifier(i *dsc.RelationIdentifier) *relation

func RelationIdentifierBuffer

func RelationIdentifierBuffer() *bytes.Buffer

func ReturnRelationIdentifierBuffer

func ReturnRelationIdentifierBuffer(b *bytes.Buffer)

func SetContextWithReason

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

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

func UpdateMetadataRelation

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

Types

type Stats

type Stats struct {
	*stats.Stats
}

func NewStats

func NewStats() *Stats

func (*Stats) CountObjects

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

func (*Stats) CountRelations

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

Jump to

Keyboard shortcuts

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