Documentation ¶
Overview ¶
The datakit package contains common patterns over 9P, which avoids the need for applications to use 9P directly.
Index ¶
- Variables
- func Head(ctx context.Context, client *Client, fromBranch string) (string, error)
- func NewTransaction(ctx context.Context, client *Client, fromBranch string) (*transaction, error)
- type BoolField
- type Client
- func (c *Client) Close(ctx context.Context)
- func (c *Client) Create(ctx context.Context, path ...string) (*File, error)
- func (c *Client) List(ctx context.Context, path []string) ([]string, error)
- func (c *Client) Mkdir(ctx context.Context, path ...string) error
- func (c *Client) Open(ctx context.Context, mode p9p.Flag, path ...string) (*File, error)
- func (c *Client) Remove(ctx context.Context, path ...string) error
- type File
- func (f *File) Close(ctx context.Context)
- func (f *File) NewFileReader(ctx context.Context) *FileReader
- func (f *File) NewIOReader(ctx context.Context, offset int64) io.Reader
- func (f *File) NewIOWriter(ctx context.Context, offset int64) io.Writer
- func (f *File) Read(ctx context.Context, p []byte, offset int64) (int, error)
- func (f *File) Write(ctx context.Context, p []byte, offset int64) (int, error)
- type FileReader
- type IntField
- type Record
- func (f *Record) BoolField(key string, value bool) *BoolField
- func (f *Record) IntField(key string, value int) *IntField
- func (r *Record) Seal(ctx context.Context) error
- func (r *Record) SetMultiple(description string, fields []*StringField, values []string) error
- func (f *Record) StringField(key string, value string) *StringField
- func (f *Record) StringRefField(key string, value *string) *StringRefField
- func (r *Record) Upgrade(ctx context.Context, schemaVersion int) error
- func (r *Record) Wait(ctx context.Context) error
- type Snapshot
- type SnapshotKind
- type StringField
- type StringRefField
- type Version
- type Watch
Constants ¶
This section is empty.
Variables ¶
var InitialVersion = Version(0)
Functions ¶
Types ¶
type BoolField ¶
type BoolField struct {
// contains filtered or unexported fields
}
func (*BoolField) HasChanged ¶
HasChanged returns true if the key has changed since the given version
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) NewFileReader ¶
func (f *File) NewFileReader(ctx context.Context) *FileReader
func (*File) NewIOReader ¶
NewIOReader creates a standard io.Reader at a given position in the file
func (*File) NewIOWriter ¶
NewIOWriter creates a standard io.Writer at a given position in the file
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
type IntField ¶
type IntField struct {
// contains filtered or unexported fields
}
func (*IntField) HasChanged ¶
HasChanged returns true if the key has changed since the given version
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record is a typed view on top of a database branch
func (*Record) BoolField ¶
BoolField defines an boolean option with a specified key and default value
func (*Record) SetMultiple ¶
func (r *Record) SetMultiple(description string, fields []*StringField, values []string) error
func (*Record) StringField ¶
func (f *Record) StringField(key string, value string) *StringField
StringField defines a string
func (*Record) StringRefField ¶
func (f *Record) StringRefField(key string, value *string) *StringRefField
StringRefField defines a string option which can be nil with a specified key and default value
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func NewSnapshot ¶
NewSnapshot opens a new snapshot referencing the given object.
type SnapshotKind ¶
type SnapshotKind uint8
const ( COMMIT SnapshotKind = 0x01 // from a commit hash OBJECT SnapshotKind = 0x02 // from an object hash )
type StringField ¶
type StringField struct {
// contains filtered or unexported fields
}
func (*StringField) Get ¶
func (f *StringField) Get() (string, Version)
Get retrieves the current value of the key
func (*StringField) HasChanged ¶
func (f *StringField) HasChanged(version Version) bool
HasChanged returns true if the key has changed since the given version
type StringRefField ¶
type StringRefField struct {
// contains filtered or unexported fields
}
func (*StringRefField) Get ¶
func (f *StringRefField) Get() (*string, Version)
Get retrieves the current value of the key
func (*StringRefField) HasChanged ¶
func (f *StringRefField) HasChanged(version Version) bool
HasChanged returns true if the key has changed since the given version