Documentation
¶
Index ¶
- Constants
- Variables
- func BindGlobalFlags(persistentFlags *pflag.FlagSet, cfg *Config) error
- type BackoffType
- type Config
- type DefaultTemplateNotFoundError
- type InvalidConfigError
- type RetryStrategy
- type SearchConfig
- type SpinnerConfig
- type TemplateConfig
- type TemplateDirectoryError
- type TemplateEntity
- type TemplateNotFoundError
- type TemplateNotRegisteredError
- type TimeoutConfig
Constants ¶
View Source
const ( AuthName = "personal-access-token" OrgIDGlobalName = "org-id" )
View Source
const (
// StreamingFlagName is the name of the --streaming flag.
StreamingFlagName = "streaming"
)
Variables ¶
View Source
var ErrInvalidBackoffType = errors.New("invalid backoff type")
View Source
var ErrUnsupportedTemplateEntity = fmt.Errorf("unsupported template entity type")
Functions ¶
Types ¶
type BackoffType ¶
type BackoffType string
const ( BackoffFixed BackoffType = "fixed" BackoffExponential BackoffType = "exponential" BackoffLinear BackoffType = "linear" )
func (BackoffType) String ¶
func (b BackoffType) String() string
func (*BackoffType) UnmarshalText ¶
func (b *BackoffType) UnmarshalText(text []byte) error
type Config ¶
type Config struct {
OutputFormat formatter.OutputFormat `yaml:"output-format" mapstructure:"output-format" doc:"Default output format (json|yaml|tree)"`
Streaming bool `yaml:"streaming" mapstructure:"streaming" doc:"Enable streaming output mode (NDJSON) for commands that support it"`
NoColor bool `yaml:"no-color" mapstructure:"no-color" doc:"Disable ANSI colors and styles"`
Spinner SpinnerConfig `yaml:"spinner" mapstructure:"spinner"`
Quiet bool `yaml:"quiet" mapstructure:"quiet" doc:"Suppress non-essential output"`
Debug bool `yaml:"debug" mapstructure:"debug"`
Timeouts TimeoutConfig `yaml:"timeouts" mapstructure:"timeouts"`
RetryStrategy RetryStrategy `yaml:"retry-strategy" mapstructure:"retry-strategy"`
Templates map[TemplateEntity]TemplateConfig `yaml:"templates" mapstructure:"templates"`
Search SearchConfig `yaml:"search" mapstructure:"search"`
DefaultTZ datetime.TimeZone `yaml:"default-tz" mapstructure:"default-tz" doc:"Default timezone for timestamps"`
}
func New ¶
func New(dataDir string) (*Config, cenclierrors.CencliError)
func (*Config) GetTemplate ¶
func (c *Config) GetTemplate(entity TemplateEntity) (TemplateConfig, TemplateNotFoundError)
func (*Config) Unmarshal ¶
func (c *Config) Unmarshal() cenclierrors.CencliError
type DefaultTemplateNotFoundError ¶
type DefaultTemplateNotFoundError interface {
cenclierrors.CencliError
Entity() string
}
func NewDefaultTemplateNotFoundError ¶
func NewDefaultTemplateNotFoundError(entity string) DefaultTemplateNotFoundError
type InvalidConfigError ¶
type InvalidConfigError interface {
cenclierrors.CencliError
}
type RetryStrategy ¶
type RetryStrategy struct {
MaxAttempts uint64 `yaml:"max-attempts" mapstructure:"max-attempts"`
BaseDelay time.Duration `yaml:"base-delay" mapstructure:"base-delay"`
MaxDelay time.Duration `yaml:"max-delay" mapstructure:"max-delay"`
Backoff BackoffType `yaml:"backoff" mapstructure:"backoff" doc:"Backoff strategy (fixed|linear|exponential)"`
}
type SearchConfig ¶
type SearchConfig struct {
// PageSize sets the default number of results per page for search.
// Must be >= 1.
PageSize int64 `yaml:"page-size" mapstructure:"page-size" doc:"Default number of results per page (must be >= 1)"`
// MaxPages limits the number of pages fetched. Set to -1 for unlimited.
// 0 is invalid and will be rejected.
MaxPages int64 `yaml:"max-pages" mapstructure:"max-pages" doc:"Number of pages to fetch (max is 100)"`
}
SearchConfig contains defaults for search pagination.
type SpinnerConfig ¶ added in v0.0.3
type TemplateConfig ¶
type TemplateConfig struct {
Path string `yaml:"path" mapstructure:"path" doc:"Path to the template file"`
}
type TemplateDirectoryError ¶
type TemplateDirectoryError interface {
cenclierrors.CencliError
}
type TemplateEntity ¶
type TemplateEntity string
const ( TemplateEntityHost TemplateEntity = "host" TemplateEntityCertificate TemplateEntity = "certificate" TemplateEntityWebProperty TemplateEntity = "webproperty" TemplateEntitySearchResult TemplateEntity = "searchresult" )
func (TemplateEntity) String ¶
func (a TemplateEntity) String() string
func (*TemplateEntity) UnmarshalText ¶
func (a *TemplateEntity) UnmarshalText(text []byte) error
type TemplateNotFoundError ¶
type TemplateNotFoundError interface {
cenclierrors.CencliError
}
type TemplateNotRegisteredError ¶
type TemplateNotRegisteredError interface {
cenclierrors.CencliError
}
type TimeoutConfig ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.