fsflag

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any[T Types] struct {
	// Allow 允许出现的值,可选
	// 当为空时不会校验,若有值,
	Allow []T

	// Check 检查值是否正常,可选,在 Parser 的时候会自动调用
	Check func(value T) error
	// contains filtered or unexported fields
}

func (*Any[T]) Set

func (a *Any[T]) Set(s string) error

func (*Any[T]) String

func (a *Any[T]) String() string

func (*Any[T]) Value

func (a *Any[T]) Value() T

type Duration

type Duration int64

func (*Duration) Duration

func (d *Duration) Duration() time.Duration

func (*Duration) Set

func (d *Duration) Set(s string) error

func (*Duration) String

func (d *Duration) String() string

type Slice

type Slice[T Types] struct {
	// Sep 多个值之间的连接符,默认为英文逗号,可选
	Sep string

	// Allow 允许出现的值,可选
	// 当为空时不会校验,若有值,
	Allow []T

	// Check 检查值是否正常,可选,在 Parser 的时候会自动调用
	Check func(values []T) error
	// contains filtered or unexported fields
}

func (*Slice[T]) GetSep

func (ss *Slice[T]) GetSep() string

func (*Slice[T]) Set

func (ss *Slice[T]) Set(s2 string) error

func (*Slice[T]) String

func (ss *Slice[T]) String() string

func (*Slice[T]) Value

func (ss *Slice[T]) Value() []T

type Types

type Types interface {
	fstypes.Ordered | ~bool
}

Jump to

Keyboard shortcuts

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