ucloudflare

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Upstream)

func WithZoneID

func WithZoneID(zoneID string) Option

type Rule

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

func RuleFromCF

func RuleFromCF(r cloudflare.DNSRecord) (Rule, error)

func RuleFromUpstream

func RuleFromUpstream(r upstream.Rule) (Rule, error)

func (*Rule) Same

func (r *Rule) Same(other Rule) bool

func (*Rule) SameUpstream

func (r *Rule) SameUpstream(other upstream.Rule) bool

type Storage

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

func NewCFStorage

func NewCFStorage(records []cloudflare.DNSRecord) (*Storage, error)

func (*Storage) Append

func (s *Storage) Append(r upstream.Rule) error

func (*Storage) Delete

func (s *Storage) Delete(q upstream.Rule) ([]upstream.Rule, error)

func (*Storage) Query

func (s *Storage) Query(q upstream.Rule) []upstream.Rule

func (*Storage) Rules

func (s *Storage) Rules() []upstream.Rule

func (*Storage) ToAdd

func (s *Storage) ToAdd() []cloudflare.DNSRecord

func (*Storage) ToDelete

func (s *Storage) ToDelete() []cloudflare.DNSRecord

type Tx

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

func (*Tx) Append

func (t *Tx) Append(r upstream.Rule) error

func (*Tx) Close

func (t *Tx) Close()

func (*Tx) Commit

func (t *Tx) Commit(ctx context.Context) error

func (*Tx) Delete

func (t *Tx) Delete(r upstream.Rule) error

type Upstream

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

func NewUpstream

func NewUpstream(token string, opts ...Option) (*Upstream, error)

func NewUpstreamWithCFC

func NewUpstreamWithCFC(cfc *cloudflare.API, opts ...Option) (*Upstream, error)

func (*Upstream) Query

func (c *Upstream) Query(ctx context.Context, r upstream.Rule) ([]upstream.Rule, error)

func (*Upstream) Tx

func (c *Upstream) Tx(ctx context.Context) (upstream.Tx, error)

Jump to

Keyboard shortcuts

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