Documentation ¶
Index ¶
- Constants
- func DeleteStore(tx *bolt.Tx, ns string) error
- type Content
- func (*Content) Descriptor() ([]byte, []int)
- func (m *Content) GetContent() *any.Any
- func (m *Content) GetHeaders() map[string]string
- func (*Content) ProtoMessage()
- func (m *Content) Reset()
- func (m *Content) String() string
- func (m *Content) XXX_DiscardUnknown()
- func (m *Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Content) XXX_Merge(src proto.Message)
- func (m *Content) XXX_Size() int
- func (m *Content) XXX_Unmarshal(b []byte) error
- type Key
- func (*Key) Descriptor() ([]byte, []int)
- func (m *Key) GetDocuments() map[string]bool
- func (m *Key) GetType() uint32
- func (k *Key) GetUniqueDocumentID() (string, bool)
- func (*Key) ProtoMessage()
- func (m *Key) Reset()
- func (m *Key) String() string
- func (m *Key) XXX_DiscardUnknown()
- func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Key) XXX_Merge(src proto.Message)
- func (m *Key) XXX_Size() int
- func (m *Key) XXX_Unmarshal(b []byte) error
- type Record
- func (*Record) Descriptor() ([]byte, []int)
- func (m *Record) GetCreatedAt() *timestamp.Timestamp
- func (m *Record) GetKeys() map[string]uint32
- func (m *Record) GetRevision() uint64
- func (m *Record) GetUpdatedAt() *timestamp.Timestamp
- func (*Record) ProtoMessage()
- func (m *Record) Reset()
- func (m *Record) String() string
- func (m *Record) XXX_DiscardUnknown()
- func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Record) XXX_Merge(src proto.Message)
- func (m *Record) XXX_Size() int
- func (m *Record) XXX_Unmarshal(b []byte) error
- type Store
- func (s *Store) DeleteContent(id string) error
- func (s *Store) DeleteRecord(id string) error
- func (s *Store) GetContent(id string) (*Content, error)
- func (s *Store) GetKey(key string) (*Key, error)
- func (s *Store) GetRecord(id string) (*Record, error)
- func (s *Store) PutContent(id string, c *Content) error
- func (s *Store) PutRecord(id string, rec *Record) error
- func (s *Store) TryGetRecord(id string) (*Record, bool, error)
- func (s *Store) UpdateKeys(id string, before, after map[string]uint32) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Content ¶
type Content struct { // headers is an arbitrary set of key/value pairs that is persisted along // with the document content. Headers map[string]string `` /* 155-byte string literal not displayed */ // content is the application-defined document content. Content *any.Any `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Content is container for a document's content.
func (*Content) Descriptor ¶
func (*Content) GetContent ¶
func (*Content) GetHeaders ¶
func (*Content) ProtoMessage ¶
func (*Content) ProtoMessage()
func (*Content) XXX_DiscardUnknown ¶
func (m *Content) XXX_DiscardUnknown()
func (*Content) XXX_Marshal ¶
func (*Content) XXX_Unmarshal ¶
type Key ¶
type Key struct { Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` Documents map[string]bool `` /* 160-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Key is an instance of a named key.
func (*Key) Descriptor ¶
func (*Key) GetDocuments ¶
func (*Key) GetUniqueDocumentID ¶
GetUniqueDocumentID returns the document ID that this unique key refers to. It returns false if k is not a unique key, or it is empty.
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) XXX_DiscardUnknown ¶
func (m *Key) XXX_DiscardUnknown()
func (*Key) XXX_Unmarshal ¶
type Record ¶
type Record struct { // revision is a 1-based document version number used to implement // optimistic concurrency control. Revision uint64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` // keys is the set of indexing keys applied to the document. keys are used // to quickly find a document or set of documents based on identifieres // other than the document ID. Keys map[string]uint32 `` /* 150-byte string literal not displayed */ // created_at is the time at which the document was created. The value is // set automatically when the document is saved. CreatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // updated_at is the time at which the document was last modified. The value // is set automatically when the document is saved. UpdatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Record is the definitive record of a document's existence.
func UnmarshalRecord ¶
UnmarshalRecord unmarshals document record.
func (*Record) Descriptor ¶
func (*Record) GetCreatedAt ¶
func (*Record) GetRevision ¶
func (*Record) GetUpdatedAt ¶
func (*Record) ProtoMessage ¶
func (*Record) ProtoMessage()
func (*Record) XXX_DiscardUnknown ¶
func (m *Record) XXX_DiscardUnknown()
func (*Record) XXX_Marshal ¶
func (*Record) XXX_Unmarshal ¶
type Store ¶
Store is the data store for a single namespace.
func CreateStore ¶
CreateStore returns the store for a single namespace, creating it if it does not exist.
func OpenStore ¶
OpenStore returns the store for the given namespace.
It returns false if the store does not exist.
func (*Store) DeleteContent ¶
DeleteContent deletes the content for the document with the given ID.
func (*Store) DeleteRecord ¶
DeleteRecord deletes a document record.
func (*Store) GetContent ¶
GetContent gets the content of the document with the given ID.
func (*Store) GetKey ¶
GetKey loads a key by its name. If the key does not exist, a pointer to a zero-value Key is returned.
func (*Store) GetRecord ¶
GetRecord loads the record for the document with the gien ID.
It is intended for use when the document is known to exist. It returns an error if the document is not in the store.
func (*Store) PutContent ¶
PutContent saves the content for a document.
func (*Store) TryGetRecord ¶
TryGetRecord loads the record for the document with the given ID.
The presence of the record is the authoratative indicator of a document's existence. It returns false if the document is not in the store.