Documentation ¶
Index ¶
- Variables
- type Storage
- func (s *Storage) Close(ctx context.Context) error
- func (s *Storage) CreateRecord(ctx context.Context, input ns.RecordInput) (record *ns.Record, err error)
- func (s *Storage) CreateZone(ctx context.Context, input ns.ZoneInput) (zone *ns.Zone, err error)
- func (s *Storage) OpenReadTransaction(ctx context.Context, fn func(ctx context.Context) error) error
- func (s *Storage) OpenWriteTransaction(ctx context.Context, fn func(ctx context.Context) error) error
- func (s *Storage) QueryRecord(ctx context.Context, input struct{ ... }) (record *ns.Record, err error)
- func (s *Storage) QueryRecords(ctx context.Context, input struct{ ... }) ([]ns.Record, error)
- func (s *Storage) QueryZone(ctx context.Context, input struct{ ... }) (*ns.Zone, error)
- func (s *Storage) QueryZones(ctx context.Context) (zones []ns.Zone, err error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrTxClosed = errors.New("transaction closed")
)
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is an implementation of a nameql.Backend interface that performs management of zones and resource records. The Storage utilize file-based storage to keep the data persisted on disk.
func NewStorage ¶
NewStorage creates a new instance of storage for the given path.
Method returns an error when file system is unavailable for more than 1 second.
func (*Storage) CreateRecord ¶
func (s *Storage) CreateRecord(ctx context.Context, input ns.RecordInput) ( record *ns.Record, err error, )
CreateRecord creates a new record within a specified zone, puts resource record information into the separate bucket.
The method works in append-only format, does not support replacement operation.
func (*Storage) CreateZone ¶
CreateZone creates a new bucket with the specified zone name and puts zone information into the $ORIGIN key.
func (*Storage) OpenReadTransaction ¶
func (*Storage) OpenWriteTransaction ¶
func (*Storage) QueryRecord ¶
func (s *Storage) QueryRecord(ctx context.Context, input struct { ZoneName string ID uint64 }) (record *ns.Record, err error)
QueryRecord attempts to find a record in a specified Zone with the ID.