Documentation
¶
Index ¶
Constants ¶
const DefaultDBFileMode = 0600
DefaultDBFileMode is the default file mode a bolt database file should be created with if nothing else is specified.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bolt ¶
Bolt represents the bbolt database used by acmeproxy to store its data.
Bolt manages the data file used by bbolt and provides factory methods for the various repositories used throughout acmeproxy.
See https://github.com/etcd-io/bbolt for more information about bbolt.
func (*Bolt) DomainRepository ¶
func (b *Bolt) DomainRepository() acme.DomainRepository
DomainRepository returns an instance of a domain repository.
func (*Bolt) UserRepository ¶
func (b *Bolt) UserRepository() acme.UserRepository
UserRepository returns an instance of a user repository.
type TestFixture ¶
type TestFixture struct { DB *Bolt // contains filtered or unexported fields }
TestFixture wraps a database suitable for testing.
After the test is done the fixture needs to be discarded by calling its Close method.
Use NewTestFixture to create an instance of this type.
func NewTestFixture ¶
func NewTestFixture(t *testing.T) *TestFixture
NewTestFixture creates a new database test fixture.
func (*TestFixture) Close ¶
func (fx *TestFixture) Close() error
Close discards the database test fixture and gets rid of all files and directories created for the test database.
func (*TestFixture) CreateBucket ¶
func (fx *TestFixture) CreateBucket(name string)
CreateBucket adds an empty bucket with the passed name to the database. It fails the test if an error occurs.
func (*TestFixture) CreateBucketWithKey ¶
func (fx *TestFixture) CreateBucketWithKey(name string, key encoding.BinaryMarshaler, value encoding.BinaryMarshaler)
CreateBucketWithKey add a bucket with the given name to the database. The bucket contains the passed key with the passed value.