Documentation ¶
Index ¶
- Constants
- Variables
- func Delete(t TX, path string) error
- func Get[T any](q Queryable, path string) (T, error)
- func GetOrPut[T any](t TX, path string, value T, fullText string) (T, error)
- func ListPaths(q Queryable, query *QueryParams) ([]string, error)
- func Mutate(d DB, fn func(TX) error) error
- func Put[T any](t TX, path string, value T, fullText string) error
- func PutAll[T any](t TX, values map[string]T) error
- func PutIfAbsent[T any](t TX, path string, value T, fullText string) (bool, error)
- func PutRaw[T any](t TX, path string, value *Raw[T], fullText string) error
- func Subscribe[T any](d DB, sub *Subscription[T]) error
- func Unsubscribe(d DB, id string)
- type ChangeSet
- type DB
- type Item
- type PBUFObject
- type QueryParams
- type Queryable
- type Raw
- type SearchParams
- type SearchResult
- type Subscription
- type TX
Constants ¶
View Source
const ( TEXT = 'T' BYTEARRAY = 'A' BYTE = '2' BOOLEAN = 'B' SHORT = 'S' INT = 'I' LONG = 'L' FLOAT = 'F' DOUBLE = 'D' PROTOCOLBUFFER = 'P' JSON = 'J' )
Variables ¶
View Source
var ( ErrUnregisteredProtobufType = errors.New("unregistered protocol buffer type") ErrUnregisteredJSONType = errors.New("unregistered json type") ErrUnkownDataType = errors.New("unknown data type") )
View Source
var (
ErrUnexpectedDBError = errors.New("unexpected database error")
)
View Source
var File_pbuf_test_proto protoreflect.FileDescriptor
Functions ¶
func PutIfAbsent ¶
func Unsubscribe ¶
Types ¶
type DB ¶
type PBUFObject ¶
type PBUFObject struct { A string `protobuf:"bytes,1,opt,name=a,proto3" json:"a,omitempty"` B float64 `protobuf:"fixed64,2,opt,name=b,proto3" json:"b,omitempty"` // contains filtered or unexported fields }
func (*PBUFObject) Descriptor
deprecated
func (*PBUFObject) Descriptor() ([]byte, []int)
Deprecated: Use PBUFObject.ProtoReflect.Descriptor instead.
func (*PBUFObject) GetA ¶
func (x *PBUFObject) GetA() string
func (*PBUFObject) GetB ¶
func (x *PBUFObject) GetB() float64
func (*PBUFObject) ProtoMessage ¶
func (*PBUFObject) ProtoMessage()
func (*PBUFObject) ProtoReflect ¶
func (x *PBUFObject) ProtoReflect() protoreflect.Message
func (*PBUFObject) Reset ¶
func (x *PBUFObject) Reset()
func (*PBUFObject) String ¶
func (x *PBUFObject) String() string
type QueryParams ¶
type QueryParams struct { Path string Start int Count int ReverseSort bool JoinDetails bool IncludeEmptyDetails bool }
func (*QueryParams) ApplyDefaults ¶
func (query *QueryParams) ApplyDefaults()
type Queryable ¶
type Queryable interface { Get(path string) ([]byte, error) List(query *QueryParams, search *SearchParams) ([]*item, error) // contains filtered or unexported methods }
type SearchParams ¶
type SearchParams struct { Search string HighlightStart string HighlightEnd string Ellipses string NumTokens int }
func (*SearchParams) ApplyDefaults ¶
func (search *SearchParams) ApplyDefaults()
type SearchResult ¶
func RSearch ¶
func RSearch[T any](q Queryable, query *QueryParams, search *SearchParams) ([]*SearchResult[*Raw[T]], error)
func Search ¶
func Search[T any](q Queryable, query *QueryParams, search *SearchParams) ([]*SearchResult[T], error)
type Subscription ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package minisql defines the subset of interfaces from database/sql that's needed to support pathdb.
|
Package minisql defines the subset of interfaces from database/sql that's needed to support pathdb. |
Click to show internal directories.
Click to hide internal directories.