executor

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCacheTTL = 5 * time.Minute
)

Variables

View Source
var (
	ZoneIDKey     = NewKey[string]("zoneID")
	ZoneNameKey   = NewKey[string]("zoneName")
	RecordIDKey   = NewKey[string]("recordID")
	RecordNameKey = NewKey[string]("recordName")
)
View Source
var ErrAborted = errors.New("aborted")

Functions

func Get added in v0.5.0

func Get[T any](ctx *Context, key Key[T]) T

func Has added in v0.5.0

func Has[T any](ctx *Context, key Key[T]) bool

func Set added in v0.5.0

func Set[T any](ctx *Context, key Key[T], value T)

Types

type CachedResult added in v0.2.0

type CachedResult struct {
	Timestamp time.Time       `json:"timestamp"`
	Data      json.RawMessage `json:"data"`
}

type Context added in v0.5.0

type Context struct {
	Cmd  *cobra.Command
	Args []string

	Client      *cf.Client
	AccountID   string
	ZoneID      string
	ZoneName    string
	RecordID    string
	RecordName  string
	Pagination  pagination.Options
	KVNamespace string

	Duration time.Duration
	Error    error
	// contains filtered or unexported fields
}

type ContextBuilder added in v0.5.0

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

func New added in v0.5.0

func New() *ContextBuilder

func (*ContextBuilder) Display added in v0.5.0

func (b *ContextBuilder) Display(fn func(ctx *Context)) *ContextBuilder

func (*ContextBuilder) Invalidates added in v0.5.0

func (b *ContextBuilder) Invalidates(fn func(ctx *Context) []string) *ContextBuilder

func (*ContextBuilder) Run added in v0.5.0

func (b *ContextBuilder) Run() func(cmd *cobra.Command, args []string)

func (*ContextBuilder) Step added in v0.5.0

func (*ContextBuilder) WithAccountID added in v0.5.0

func (b *ContextBuilder) WithAccountID() *ContextBuilder

func (*ContextBuilder) WithClient added in v0.5.0

func (b *ContextBuilder) WithClient() *ContextBuilder

func (*ContextBuilder) WithConfirmation added in v0.5.0

func (b *ContextBuilder) WithConfirmation(message string) *ContextBuilder

func (*ContextBuilder) WithConfirmationFunc added in v0.5.0

func (b *ContextBuilder) WithConfirmationFunc(fn func(ctx *Context) string) *ContextBuilder

func (*ContextBuilder) WithDNSRecord added in v0.5.0

func (b *ContextBuilder) WithDNSRecord() *ContextBuilder

func (*ContextBuilder) WithKVNamespace added in v0.5.0

func (b *ContextBuilder) WithKVNamespace() *ContextBuilder

func (*ContextBuilder) WithNoCache added in v0.5.0

func (b *ContextBuilder) WithNoCache() *ContextBuilder

func (*ContextBuilder) WithPagination added in v0.5.0

func (b *ContextBuilder) WithPagination() *ContextBuilder

func (*ContextBuilder) WithZone added in v0.5.0

func (b *ContextBuilder) WithZone() *ContextBuilder

type Key added in v0.5.0

type Key[T any] struct {
	// contains filtered or unexported fields
}

func NewKey added in v0.5.0

func NewKey[T any](name string) Key[T]

func (Key[T]) Name added in v0.5.0

func (k Key[T]) Name() string

type Step added in v0.5.0

type Step[T any] struct {
	// contains filtered or unexported fields
}

func NewStep added in v0.5.0

func NewStep[T any](key Key[T], message string) *Step[T]

func (*Step[T]) CacheKey added in v0.5.0

func (s *Step[T]) CacheKey(key string) *Step[T]

func (*Step[T]) CacheKeyFunc added in v0.5.0

func (s *Step[T]) CacheKeyFunc(fn func(*Context) string) *Step[T]

func (*Step[T]) Func added in v0.5.0

func (s *Step[T]) Func(fn func(*Context, chan<- string) (T, error)) *Step[T]

func (*Step[T]) Silent added in v0.5.0

func (s *Step[T]) Silent() *Step[T]

type StepRunner added in v0.5.0

type StepRunner interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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