edsl

package
v0.0.0-...-6091203 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommaEqSpaceTag

type CommaEqSpaceTag interface {
	Tag

	Nil() CommaEqSpaceTag
	Key(key string) CommaEqSpaceTag
	Entry(key string, values ...interface{}) CommaEqSpaceTag
	EntryString(key string, values ...string) CommaEqSpaceTag
}

type CommaTag

type CommaTag interface {
	Tag

	Nil() CommaTag
	Key(key string) CommaTag
}

type Filer

type Filer interface {
	fmt.Stringer

	Header(text string) Filer
	Imports(packages ...string) Filer
	Structs(structs ...Structer) Filer
}

type SemiColonTag

type SemiColonTag interface {
	Tag

	Nil() SemiColonTag
	Key(key string) SemiColonTag
	Entry(key string, value interface{}) SemiColonTag
}

type Structer

type Structer interface {
	fmt.Stringer

	Header(text string) Structer

	Field(name string, typ reflect.Type, comment string, tags ...Tag) Structer
	RawTypedField(name string, rawType ast.Expr, comment string, tags ...Tag) Structer
	Of(val interface{}) Structer

	ForEach(fn func(name string, typ reflect.Type, tags []Tag))
	FieldNames() []string
	TagKeys(name string) []string
	TagValues(name, key string) []string

	Type() reflect.Type
	Value() reflect.Value
	Interface() interface{}
}

type Tag

type Tag interface {
	fmt.Stringer

	Name() string
	FirstKey() string
	Value(key string) string
	Values(key string) []string
	Of(tagger Tag) Tag
}

type TagStyle

type TagStyle int
const (
	TagStyleComma TagStyle = iota
	TagStyleCommaEqSpace
	TagStyleSemiColon
)

type Tagger

type Tagger interface {
	// Comma `name:"key1,key2,,,"`
	Comma(name string) CommaTag
	// CommaEqSpace `name:"key1=value,key2=value1 value2,,,key3,,,"`
	CommaEqSpace(name string) CommaEqSpaceTag
	// SemiColon `name:"key1:value2;key2;key3:value3;;;"`
	SemiColon(name string) SemiColonTag
}

Jump to

Keyboard shortcuts

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