Documentation ¶
Index ¶
- func InitSchema(conn conn, pageSize int, triggers bool) error
- func NewPiecesStorage(opts NewPiecesStorageOpts) (_ storage.ClientImplCloser, err error)
- func NewPool(opts NewPoolOpts) (_ ConnPool, _ ProviderOpts, err error)
- func NewProvider(pool ConnPool, opts ProviderOpts) (_ *provider, err error)
- func SetCapacity(conn conn, cap int64) error
- func UnlimitCapacity(conn conn) error
- type ConnPool
- type NewPiecesStorageOpts
- type NewPoolOpts
- type ProviderOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSchema ¶
func NewPiecesStorage ¶
func NewPiecesStorage(opts NewPiecesStorageOpts) (_ storage.ClientImplCloser, err error)
A convenience function that creates a connection pool, resource provider, and a pieces storage ClientImpl and returns them all with a Close attached.
func NewPool ¶
func NewPool(opts NewPoolOpts) (_ ConnPool, _ ProviderOpts, err error)
func NewProvider ¶
func NewProvider(pool ConnPool, opts ProviderOpts) (_ *provider, err error)
Needs the ConnPool size so it can initialize all the connections with pragmas. Takes ownership of the ConnPool (since it has to initialize all the connections anyway).
func SetCapacity ¶
Set the capacity limit to exactly this value.
Types ¶
type NewPiecesStorageOpts ¶
type NewPiecesStorageOpts struct { NewPoolOpts ProvOpts func(*ProviderOpts) StorageOpts func(*storage.ResourcePiecesOpts) }
type NewPoolOpts ¶
type NewPoolOpts struct { // See https://www.sqlite.org/c3ref/open.html. NB: "If the filename is an empty string, then a // private, temporary on-disk database will be created. This private database will be // automatically deleted as soon as the database connection is closed." Path string Memory bool NumConns int // Forces WAL, disables shared caching. NoConcurrentBlobReads bool DontInitSchema bool PageSize int // If non-zero, overrides the existing setting. Capacity int64 }
type ProviderOpts ¶
type ProviderOpts struct { NumConns int // Concurrent blob reads require WAL. NoConcurrentBlobReads bool BatchWrites bool MmapSize int64 MmapSizeOk bool }
There's some overlap here with NewPoolOpts, and I haven't decided what needs to be done. For now, the fact that the pool opts are a superset, means our helper NewPiecesStorage can just take the top-level option type.
Click to show internal directories.
Click to hide internal directories.