Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MergeOverwrite overwrite arg when merging. MergeOverwrite = iota // MergeAdditive concat argument lists. MergeAdditive // MergeDenied fail merge if another object has the arg defined. MergeDenied )
Variables ¶
This section is empty.
Functions ¶
func NewDenylistError ¶ added in v0.6.0
NewDenylistError returns a DenyListError.
Types ¶
type Args ¶
Args represents a set of args.
func (Args) Merge ¶
func (a Args) Merge(args Args, setters ...MergeOption) error
Merge implements the ArgsBuilder interface.
func (Args) MustMerge ¶ added in v0.13.0
func (a Args) MustMerge(args Args, setters ...MergeOption)
MustMerge implements the ArgsBuilder interface.
type ArgsBuilder ¶
type ArgsBuilder interface { MustMerge(Args, ...MergeOption) Merge(Args, ...MergeOption) error Set(string, string) ArgsBuilder Args() []string }
ArgsBuilder defines the requirements to build and manage a set of args.
type DenyListError ¶ added in v0.6.0
type DenyListError struct {
// contains filtered or unexported fields
}
DenyListError represents an error indicating that an argument was supplied that is not allowed.
func (*DenyListError) Error ¶ added in v0.6.0
func (b *DenyListError) Error() string
Error implements the Error interface.
type MergeOption ¶ added in v0.13.0
type MergeOption func(*MergeOptions)
MergeOption optional merge argument setter.
func WithDenyList ¶ added in v0.13.0
func WithDenyList(denyList Args) MergeOption
WithDenyList disable merge for all keys in map.
func WithMergePolicies ¶ added in v0.13.0
func WithMergePolicies(policies MergePolicies) MergeOption
WithMergePolicies set merge policies during merge.
type MergeOptions ¶ added in v0.13.0
type MergeOptions struct {
Policies MergePolicies
}
MergeOptions provides optional arguments for merge.
type MergePolicies ¶ added in v0.13.0
type MergePolicies map[string]MergePolicy
MergePolicies merge policy map.
type MergePolicy ¶ added in v0.13.0
type MergePolicy int
MergePolicy defines args builder args merging policy.
Click to show internal directories.
Click to hide internal directories.