cloudflare

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSService

type DNSService interface {
	Create(
		zoneID string,
		t string,
		name string,
		content string,
		ttl int,
		priority int,
		proxied bool,
	) (model.CloudflareDNSRecord, error)
	DeleteByIDOrNameAndType(zone model.CloudflareZone, id string) (model.CloudflareDNSRecord, error)
	FindSingleByIDOrNameAndType(zone model.CloudflareZone, id, t string) (model.CloudflareDNSRecord, error)
	List(zoneID string) ([]model.CloudflareDNSRecord, error)
	UpdateARecordContentToPublicIPV4(zone model.CloudflareZone, id string) (model.CloudflareDNSRecord, error)
}

DNSService is the interface to manage Cloudflare zones service logic

type DNSServiceObj

type DNSServiceObj struct {
	Config     *model.CloudflareConfig
	Repository cloudflareRepo.DNSRecordRepository
}

DNSServiceObj implements the DNSService interface per default

func NewDNSService

func NewDNSService(config *model.CloudflareConfig) (*DNSServiceObj, error)

NewDNSService returns a new pointer instance of DNSServiceObj with default values

func (*DNSServiceObj) Create

func (serv *DNSServiceObj) Create(
	zoneID string,
	t string,
	name string,
	content string,
	ttl int,
	priority int,
	proxied bool,
) (model.CloudflareDNSRecord, error)

Create a new DNS record

func (*DNSServiceObj) DeleteByIDOrNameAndType

func (serv *DNSServiceObj) DeleteByIDOrNameAndType(zone model.CloudflareZone, id, t string) (model.CloudflareDNSRecord, error)

DeleteByIDOrNameAndType deletes a DNS record from a zone and identifies it either by its ID or name + type

func (*DNSServiceObj) FindSingleByIDOrNameAndType

func (serv *DNSServiceObj) FindSingleByIDOrNameAndType(zone model.CloudflareZone, id, t string) (model.CloudflareDNSRecord, error)

FindSingleByIDOrNameAndType tries to find a single DNS record for a zone by ID or with its name and type.

func (*DNSServiceObj) List

func (serv *DNSServiceObj) List(zoneID string) ([]model.CloudflareDNSRecord, error)

List returns a full list of DNS records for a zone

func (*DNSServiceObj) UpdateARecordContentToPublicIPV4

func (serv *DNSServiceObj) UpdateARecordContentToPublicIPV4(zone model.CloudflareZone, id string) (model.CloudflareDNSRecord, error)

UpdateARecordContentToPublicIPV4 updates the DNS record content to fetched public IPv4

type ZoneService

type ZoneService interface {
	FindByIDOrName(id string) (model.CloudflareZone, error)
	List() ([]model.CloudflareZone, error)
}

ZoneService is the interface to manage Cloudflare zones service logic

type ZoneServiceObj

type ZoneServiceObj struct {
	Config     *model.CloudflareConfig
	Repository cloudflareRepo.ZoneRepository
}

ZoneServiceObj implements the ZoneService interface per default

func NewZoneService

func NewZoneService(config *model.CloudflareConfig) (*ZoneServiceObj, error)

NewZoneService returns a new pointer instance of ZoneServiceObj with default values

func (*ZoneServiceObj) FindByIDOrName

func (serv *ZoneServiceObj) FindByIDOrName(id string) (model.CloudflareZone, error)

FindByIDOrName tries to find a Cloudflare zone through the API via its ID or name

func (*ZoneServiceObj) List

func (serv *ZoneServiceObj) List() ([]model.CloudflareZone, error)

List returns a full list of zones

Jump to

Keyboard shortcuts

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