nameql

package
v0.0.0-...-e5d9080 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(activestorage ActiveStorage) http.Handler

Types

type ActiveStorage

type ActiveStorage interface {
	CreateZone(ctx context.Context, input ns.ZoneInput) (*ns.Zone, error)
	QueryZone(ctx context.Context, input struct{ Name string }) (*ns.Zone, error)
	QueryZones(ctx context.Context) ([]ns.Zone, error)

	CreateRecord(ctx context.Context, input ns.RecordInput) (*ns.Record, error)
	QueryRecord(ctx context.Context, input struct {
		ZoneName string
		ID       uint64
	}) (*ns.Record, error)
	QueryRecords(ctx context.Context, input struct {
		ZoneName string
	}) ([]ns.Record, error)

	// OpenReadTransaction creates a new read-only transaction to execute the
	// provided operation.
	//
	// This method is executed before all query operations to make the result
	// consistent. For backends without transactional support, consider simply
	// calling a specified operation.
	OpenReadTransaction(ctx context.Context, op func(context.Context) error) error

	// OpenWriteTransaction creates a read/write tansaction to execute the
	// provided operation.
	//
	// This method is executed before all mutating operations.
	OpenWriteTransaction(ctx context.Context, op func(context.Context) error) error

	// Close closes a storage.
	Close(context.Context) error
}

type StubBackend

type StubBackend struct{}

func (StubBackend) CreateRecord

func (b StubBackend) CreateRecord(context.Context, ns.RecordInput) (*ns.Record, error)

func (StubBackend) CreateZone

func (b StubBackend) CreateZone(context.Context, ns.ZoneInput) (*ns.Zone, error)

func (StubBackend) QueryRecords

func (b StubBackend) QueryRecords(context.Context) ([]ns.Record, error)

func (StubBackend) QueryZones

func (b StubBackend) QueryZones(context.Context) ([]ns.Zone, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL