Documentation
¶
Index ¶
- Constants
- Variables
- func Get[T any](ctx *Context, key Key[T]) T
- func Has[T any](ctx *Context, key Key[T]) bool
- func Set[T any](ctx *Context, key Key[T], value T)
- type CachedResult
- type Context
- type ContextBuilder
- func (b *ContextBuilder) Display(fn func(ctx *Context)) *ContextBuilder
- func (b *ContextBuilder) Invalidates(fn func(ctx *Context) []string) *ContextBuilder
- func (b *ContextBuilder) Run() func(cmd *cobra.Command, args []string)
- func (b *ContextBuilder) Step(s StepRunner) *ContextBuilder
- func (b *ContextBuilder) WithAccountID() *ContextBuilder
- func (b *ContextBuilder) WithClient() *ContextBuilder
- func (b *ContextBuilder) WithConfirmation(message string) *ContextBuilder
- func (b *ContextBuilder) WithConfirmationFunc(fn func(ctx *Context) string) *ContextBuilder
- func (b *ContextBuilder) WithDNSRecord() *ContextBuilder
- func (b *ContextBuilder) WithKVNamespace() *ContextBuilder
- func (b *ContextBuilder) WithNoCache() *ContextBuilder
- func (b *ContextBuilder) WithPagination() *ContextBuilder
- func (b *ContextBuilder) WithZone() *ContextBuilder
- type Key
- type Step
- type StepRunner
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 ¶
Types ¶
type CachedResult ¶ added in v0.2.0
type CachedResult struct {
Timestamp time.Time `json:"timestamp"`
Data json.RawMessage `json:"data"`
}
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 (b *ContextBuilder) Step(s StepRunner) *ContextBuilder
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 Step ¶ added in v0.5.0
type Step[T any] struct { // contains filtered or unexported fields }
func (*Step[T]) CacheKeyFunc ¶ added in v0.5.0
type StepRunner ¶ added in v0.5.0
type StepRunner interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.