flags

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(s reflect.StructTag, tagName string) (flags Flags, targetNameRule NameConvertRule)

Parse _ use "copy" if tagName is empty.

Types

type Flags

type Flags map[cms.CopyMergeStrategy]bool

Flags is an efficient manager for a group of CopyMergeStrategy items.

func New

func New(ftf ...cms.CopyMergeStrategy) Flags

New creates a new instance for Flags.

func (Flags) Clone

func (flags Flags) Clone() (n Flags)

func (Flags) Format

func (flags Flags) Format(s fmt.State, verb rune)

func (Flags) IsAllFlagsOK

func (flags Flags) IsAllFlagsOK(ftf ...cms.CopyMergeStrategy) bool

func (Flags) IsAnyFlagsOK

func (flags Flags) IsAnyFlagsOK(ftf ...cms.CopyMergeStrategy) bool

func (Flags) IsFlagOK

func (flags Flags) IsFlagOK(ftf cms.CopyMergeStrategy) bool

func (Flags) IsGroupedFlagOK

func (flags Flags) IsGroupedFlagOK(ftf ...cms.CopyMergeStrategy) (ok bool)

IsGroupedFlagOK test if any of ftf is exists.

If one of ftf is the leader (a.k.a. the first one) of a toggleable group (such as map-copy and map-merge), and, any of the group is not exists (either map-copy and map-merge), IsGroupedFlagOK will report true just like map-copy was in Flags.

func (Flags) String

func (flags Flags) String() string

func (Flags) StringEx

func (flags Flags) StringEx() string

func (Flags) WithFlags

func (flags Flags) WithFlags(flg ...cms.CopyMergeStrategy) Flags

type NameConvertRule

type NameConvertRule string

NameConvertRule wraps the rule with string representations into a struct.

func (NameConvertRule) FromName

func (s NameConvertRule) FromName() string

func (NameConvertRule) IsIgnored

func (s NameConvertRule) IsIgnored() bool

func (NameConvertRule) ToName

func (s NameConvertRule) ToName() string

func (NameConvertRule) Valid

func (s NameConvertRule) Valid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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