Documentation ¶
Index ¶
- Constants
- Variables
- func BucketExists(tx *bolt.Tx, path Path) (bool, error)
- func CreateBucket(tx *bolt.Tx, path Path) (*bolt.Bucket, error)
- func Delete(ctx context.Context, tx *bolt.Tx, path Path, key string) error
- func DeleteBucket(tx *bolt.Tx, path Path) error
- func DeleteKey(tx *bolt.Tx, path Path, key string) error
- func ErrIsNotFound(err error) bool
- func Get[T any, M Message[T]](ctx context.Context, tx *bolt.Tx, path Path, key string) (M, error)
- func GetAny[T any](ctx context.Context, tx *bolt.Tx, path Path, key string) (*T, error)
- func GetKey(tx *bolt.Tx, path Path, key string) ([]byte, error)
- func GetObject(ctx context.Context, tx *bolt.Tx, path Path, key string) (*dsc3.Object, error)
- func GetRelation(ctx context.Context, tx *bolt.Tx, path Path, key string) (*dsc3.Relation, error)
- func KeyExists(tx *bolt.Tx, path Path, key string) (bool, error)
- func List[T any, M Message[T]](ctx context.Context, tx *bolt.Tx, path Path) ([]M, error)
- func ListBuckets(tx *bolt.Tx, path Path) ([]string, error)
- func Marshal[T any, M Message[T]](t M) ([]byte, error)
- func Scan[T any, M Message[T]](ctx context.Context, tx *bolt.Tx, path Path, filter string) ([]M, error)
- func Set[T any, M Message[T]](ctx context.Context, tx *bolt.Tx, path Path, key string, t M) (M, error)
- func SetAny[T any](ctx context.Context, tx *bolt.Tx, path Path, key string, t *T) (*T, error)
- func SetBucket(tx *bolt.Tx, path Path) (*bolt.Bucket, error)
- func SetKey(tx *bolt.Tx, path Path, key string, value []byte) error
- func SetObject(ctx context.Context, tx *bolt.Tx, path Path, key string, obj *dsc3.Object) (*dsc3.Object, error)
- func SetRelation(ctx context.Context, tx *bolt.Tx, path Path, key string, rel *dsc3.Relation) (*dsc3.Relation, error)
- func Unmarshal[T any, M Message[T]](b []byte) (M, error)
- func UpdateMetadataObject(ctx context.Context, tx *bolt.Tx, path []string, key string, msg *dsc3.Object) (*dsc3.Object, error)
- func UpdateMetadataRelation(ctx context.Context, tx *bolt.Tx, path []string, key string, ...) (*dsc3.Relation, error)
- type BoltDB
- type Config
- type Iterator
- type Message
- type PageIterator
- type PagedIterator
- type Path
- type ScanArgs
- type ScanIterator
- func (s *ScanIterator[T, M]) Delete() error
- func (s *ScanIterator[T, M]) Key() string
- func (s *ScanIterator[T, M]) Next() bool
- func (s *ScanIterator[T, M]) RawKey() []byte
- func (s *ScanIterator[T, M]) RawValue() []byte
- func (s *ScanIterator[T, M]) SetFilter(filters []func(M) bool)
- func (s *ScanIterator[T, M]) Value() M
- type ScanOption
Constants ¶
Variables ¶
View Source
var ( ErrPathNotFound = cerr.NewAsertoError("E20050", codes.NotFound, http.StatusNotFound, "path not found") ErrKeyNotFound = cerr.NewAsertoError("E20051", codes.NotFound, http.StatusNotFound, "key not found") ErrKeyExists = cerr.NewAsertoError("E20052", codes.AlreadyExists, http.StatusConflict, "key already exists") ErrMultipleResults = cerr.NewAsertoError("E20053", codes.FailedPrecondition, http.StatusExpectationFailed, "multiple results for singleton request") )
Error codes returned by failures to parse an expression.
Functions ¶
func BucketExists ¶
BucketExists, check if bucket path exists.
func CreateBucket ¶
CreateBucket, create bucket path if not exists.
func DeleteBucket ¶
DeleteBucket, delete tail bucket of path provided.
func DeleteKey ¶
DeleteKey, delete key and value in path specified bucket, when it exists. None existing keys will not raise an error.
func ErrIsNotFound ¶ added in v0.30.0
func GetRelation ¶ added in v0.31.4
func ListBuckets ¶ added in v0.30.0
ListBuckets, returns the bucket name underneath the path.
func SetRelation ¶ added in v0.31.4
func UpdateMetadataObject ¶ added in v0.31.4
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
BoltDB based key-value store.
type Iterator ¶ added in v0.21.5
type Iterator[T any, M Message[T]] interface { Next() bool // move cursor to next element. RawKey() []byte // return raw key value ([]byte). RawValue() []byte // return ram value value ([]byte). Key() string // return key value (string). Value() M // return typed value (M). Delete() error // delete element underneath cursor. }
type PageIterator ¶ added in v0.21.5
func (*PageIterator[T, M]) Next ¶ added in v0.21.5
func (p *PageIterator[T, M]) Next() bool
func (*PageIterator[T, M]) NextToken ¶ added in v0.21.5
func (p *PageIterator[T, M]) NextToken() string
func (*PageIterator[T, M]) Value ¶ added in v0.21.5
func (p *PageIterator[T, M]) Value() []M
type PagedIterator ¶ added in v0.21.5
func NewPageIterator ¶ added in v0.21.5
func NewPageIterator[T any, M Message[T]](ctx context.Context, tx *bolt.Tx, path Path, opts ...ScanOption) (PagedIterator[T, M], error)
type Path ¶ added in v0.21.5
type Path []string
var ( SystemPath Path = []string{"_system"} ManifestPath Path = []string{"_manifest", ManifestName, ManifestVersion} ObjectTypesPath Path = []string{"object_types"} PermissionsPath Path = []string{"permissions"} RelationTypesPath Path = []string{"relation_types"} ObjectsPath Path = []string{"objects"} RelationsSubPath Path = []string{"relations_sub"} RelationsObjPath Path = []string{"relations_obj"} )
type ScanIterator ¶ added in v0.21.5
func (*ScanIterator[T, M]) Delete ¶ added in v0.21.5
func (s *ScanIterator[T, M]) Delete() error
func (*ScanIterator[T, M]) Key ¶ added in v0.21.5
func (s *ScanIterator[T, M]) Key() string
func (*ScanIterator[T, M]) Next ¶ added in v0.21.5
func (s *ScanIterator[T, M]) Next() bool
func (*ScanIterator[T, M]) RawKey ¶ added in v0.21.5
func (s *ScanIterator[T, M]) RawKey() []byte
func (*ScanIterator[T, M]) RawValue ¶ added in v0.21.5
func (s *ScanIterator[T, M]) RawValue() []byte
func (*ScanIterator[T, M]) SetFilter ¶ added in v0.21.5
func (s *ScanIterator[T, M]) SetFilter(filters []func(M) bool)
func (*ScanIterator[T, M]) Value ¶ added in v0.21.5
func (s *ScanIterator[T, M]) Value() M
type ScanOption ¶ added in v0.21.5
type ScanOption func(*ScanArgs)
func WithKeyFilter ¶ added in v0.21.5
func WithKeyFilter(filter string) ScanOption
func WithPageSize ¶ added in v0.21.5
func WithPageSize(size int32) ScanOption
func WithPageToken ¶ added in v0.21.5
func WithPageToken(token string) ScanOption
Click to show internal directories.
Click to hide internal directories.