zone

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseZone

func ParseZone(msg *happydns.ZoneMessage) (*happydns.Zone, error)

Types

type CreateZoneUsecase

type CreateZoneUsecase struct {
	// contains filtered or unexported fields
}

func NewCreateZoneUsecase

func NewCreateZoneUsecase(store ZoneStorage) *CreateZoneUsecase

func (*CreateZoneUsecase) Create

func (uc *CreateZoneUsecase) Create(zone *happydns.Zone) error

type DeleteZoneUsecase

type DeleteZoneUsecase struct {
	// contains filtered or unexported fields
}

func NewDeleteZoneUsecase

func NewDeleteZoneUsecase(store ZoneStorage) *DeleteZoneUsecase

func (*DeleteZoneUsecase) Delete

func (uc *DeleteZoneUsecase) Delete(zoneID happydns.Identifier) error

type GetZoneUsecase

type GetZoneUsecase struct {
	// contains filtered or unexported fields
}

func NewGetZoneUsecase

func NewGetZoneUsecase(store ZoneStorage) *GetZoneUsecase

func (*GetZoneUsecase) Get

func (uc *GetZoneUsecase) Get(zoneID happydns.Identifier) (*happydns.Zone, error)

func (*GetZoneUsecase) GetInDomain

func (uc *GetZoneUsecase) GetInDomain(zoneID happydns.Identifier, domain *happydns.Domain) (*happydns.Zone, error)

func (*GetZoneUsecase) GetMeta

func (uc *GetZoneUsecase) GetMeta(zoneID happydns.Identifier) (*happydns.ZoneMeta, error)

type ListRecordsUsecase

type ListRecordsUsecase struct {
	// contains filtered or unexported fields
}

func NewListRecordsUsecase

func NewListRecordsUsecase(serviceListRecordsUC *service.ListRecordsUsecase) *ListRecordsUsecase

func (*ListRecordsUsecase) List

func (uc *ListRecordsUsecase) List(domain *happydns.Domain, zone *happydns.Zone) (rrs []happydns.Record, err error)

func (*ListRecordsUsecase) ToZoneFile

func (uc *ListRecordsUsecase) ToZoneFile(domain *happydns.Domain, zone *happydns.Zone) (string, error)

type Service

type Service struct {
	CreateZoneUC  *CreateZoneUsecase
	DeleteZoneUC  *DeleteZoneUsecase
	DiffZoneUC    *ZoneDifferUsecase
	GetZoneUC     *GetZoneUsecase
	ListRecordsUC *ListRecordsUsecase
	UpdateZoneUC  *UpdateZoneUsecase
}

func NewZoneUsecases

func NewZoneUsecases(store ZoneStorage, serviceUC *service.Service) *Service

func (*Service) CreateZone

func (s *Service) CreateZone(zone *happydns.Zone) error

func (*Service) DeleteZone

func (s *Service) DeleteZone(zoneid happydns.Identifier) error

func (*Service) DiffZones

func (s *Service) DiffZones(domain *happydns.Domain, newZone *happydns.Zone, oldZoneID happydns.Identifier) ([]*happydns.Correction, error)

func (*Service) FlattenZoneFile

func (s *Service) FlattenZoneFile(domain *happydns.Domain, zone *happydns.Zone) (string, error)

func (*Service) GenerateRecords

func (s *Service) GenerateRecords(domain *happydns.Domain, zone *happydns.Zone) ([]happydns.Record, error)

func (*Service) GetZone

func (s *Service) GetZone(zoneid happydns.Identifier) (*happydns.Zone, error)

func (*Service) GetZoneMeta

func (s *Service) GetZoneMeta(zoneid happydns.Identifier) (*happydns.ZoneMeta, error)

func (*Service) LoadZoneFromId

func (s *Service) LoadZoneFromId(domain *happydns.Domain, id happydns.Identifier) (*happydns.Zone, error)

func (*Service) UpdateZone

func (s *Service) UpdateZone(zoneID happydns.Identifier, updateFn func(*happydns.Zone)) error

type UpdateZoneUsecase

type UpdateZoneUsecase struct {
	// contains filtered or unexported fields
}

func NewUpdateZoneUsease

func NewUpdateZoneUsease(store ZoneStorage, getZone *GetZoneUsecase) *UpdateZoneUsecase

func (*UpdateZoneUsecase) Update

func (uc *UpdateZoneUsecase) Update(zoneID happydns.Identifier, updateFn func(*happydns.Zone)) error

type ZoneDifferUsecase

type ZoneDifferUsecase struct {
	// contains filtered or unexported fields
}

func NewZoneDifferUsecase

func NewZoneDifferUsecase(getZone *GetZoneUsecase, listRecords *ListRecordsUsecase) *ZoneDifferUsecase

func (*ZoneDifferUsecase) Diff

func (uc *ZoneDifferUsecase) Diff(domain *happydns.Domain, newzone *happydns.Zone, oldzoneid happydns.Identifier) ([]*happydns.Correction, error)

type ZoneStorage

type ZoneStorage interface {
	// ListAllZones retrieves the list of known Zones.
	ListAllZones() (happydns.Iterator[happydns.ZoneMessage], error)

	// GetZoneMeta retrieves metadatas of the Zone with the given identifier.
	GetZoneMeta(zoneid happydns.Identifier) (*happydns.ZoneMeta, error)

	// GetZone retrieves the full Zone (including Services and metadatas) which have the given identifier.
	GetZone(zoneid happydns.Identifier) (*happydns.ZoneMessage, error)

	// CreateZone creates a record in the database for the given Zone.
	CreateZone(zone *happydns.Zone) error

	// UpdateZone updates the fields of the given Zone.
	UpdateZone(zone *happydns.Zone) error

	// DeleteZone removes the given Zone from the database.
	DeleteZone(zoneid happydns.Identifier) error

	// ClearZones deletes all Zones present in the database.
	ClearZones() error
}

Source Files

  • create_zone.go
  • delete_zone.go
  • factory.go
  • get_zone.go
  • list_records.go
  • parse_zone.go
  • update_zone.go
  • zone_differ.go
  • zone_storage.go

Jump to

Keyboard shortcuts

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