types

package
v6.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTomlFilesCheck       = errors.New("error checking for .toml files")
	ErrRequirementsNotMet   = errors.New("generation requirements not met: either cmd-line-options.csv must exist or classDefinitions folder must exist with at least one .toml file")
	ErrEmptyTemplatesFolder = errors.New("templates folder exists but is empty; it must contain cmd-line-options.csv and/or classDefinitions/ folder with .toml files")
)
View Source
var ErrNoTemplateFolder = errors.New("could not find the templates directory")

Functions

func CamelCase

func CamelCase(s string) string

func FirstLower

func FirstLower(s string) string

func FirstUpper

func FirstUpper(s string) string

func GetGeneratedPath

func GetGeneratedPath() string

func GoName

func GoName(s string) string

func IsVerbose

func IsVerbose() bool

func LoadCsv

func LoadCsv[T Validater, D any](basePath string, callBack func(*T, *D) (bool, error), data *D) ([]T, error)

LoadCsv loads a csv file into a Validater (which is any type that implements the Validate() method). The callBack function is called for each record in the csv file. If the callBack function returns false, the record is skipped. If the callBack function returns an error, the function quits and returns the error.

func Lower

func Lower(s string) string

func LowerNoSpaces

func LowerNoSpaces(s string) string

func MarkdownTable

func MarkdownTable(header []string, rows [][]string) string

func Pad

func Pad(s string, width int) string

func Plural

func Plural(s string) string

func Proper

func Proper(s string) string

func SetVerbose

func SetVerbose(v bool)

func Singular

func Singular(s string) string

func Upper

func Upper(s string) string

func ValidateEnums

func ValidateEnums(path string, enums []string) (bool, string)

func ValidateTemplate

func ValidateTemplate(content, templatePath string) error

ValidateTemplate validates that EXISTING_CODE markers are properly formatted

func ValidateTemplatesFolder

func ValidateTemplatesFolder() error

ValidateTemplatesFolder checks if the templates folder exists and isn't empty

func VerboseLog

func VerboseLog(args ...interface{})

func WriteCode

func WriteCode(existingFn, newCode string) (bool, error)

Types

type CodeBase

type CodeBase struct {
	Commands   []Command   `json:"commands"`
	Structures []Structure `json:"structures"`
	BaseTypes  []Structure `json:"baseTypes"`
}

CodeBase - the top-level structure for the codebase which carries an array of Commands which describe, in combination with the Structures, the command line options, help file text, and SDK definitions.

func LoadCodebase

func LoadCodebase() (CodeBase, error)

LoadCodebase loads the two csv files and returns the codebase which contains all the commands (each with its own set of options).

func (*CodeBase) Description

func (cb *CodeBase) Description() string

Description - returns the description of the codebase for the openapi.yaml file

func (*CodeBase) FinishLoad

func (cb *CodeBase) FinishLoad(unused string, baseTypes []Structure, options []Option, structMap map[string]Structure) error

func (*CodeBase) Generate

func (cb *CodeBase) Generate()

Generate generates the code for the codebase using the given templates.

func (*CodeBase) GroupList

func (cb *CodeBase) GroupList(filter string) []Command

func (*CodeBase) Handlers

func (cb *CodeBase) Handlers() string

func (*CodeBase) LoadMembers

func (cb *CodeBase) LoadMembers(basePath string, structMap map[string]Structure) error

func (*CodeBase) LoadStructures

func (cb *CodeBase) LoadStructures(basePath string, callBack func(*Structure, *any) (bool, error), structMap map[string]Structure) error

func (*CodeBase) ProcessFile

func (item *CodeBase) ProcessFile(source, group, reason string) error

ProcessFile processes a single file, applying the template to it and writing the result to the destination.

func (*CodeBase) ProcessGroupFile

func (item *CodeBase) ProcessGroupFile(source, group, reason string) error

ProcessGroupFile processes a single file, applying the template to it and writing the result to the destination.

func (*CodeBase) RouteToGroup

func (cb *CodeBase) RouteToGroup(route string) string

RouteToGroup - returns the group given a route

func (*CodeBase) SortedStructs

func (cb *CodeBase) SortedStructs() []Structure

func (*CodeBase) String

func (c *CodeBase) String() string

String - returns a JSON representation of the codebase

func (*CodeBase) SummaryTag

func (cb *CodeBase) SummaryTag(filter string) string

SummaryTag - returns a summary of the commands used in the helpText

func (*CodeBase) TagSummary

func (cb *CodeBase) TagSummary() string

TagSummary - returns a summary of the tags used in the openapi.yaml file

func (*CodeBase) TypeToGroup

func (cb *CodeBase) TypeToGroup(typ string) string

TypeToGroup - returns the group given a type

func (*CodeBase) Validate

func (cb *CodeBase) Validate() error

Validate - called from FinishLoad to validate the codebase

func (*CodeBase) Version

func (cb *CodeBase) Version(verbose bool) string

Version - returns the version of the codebase

func (*CodeBase) Views

func (cb *CodeBase) Views() string

type Command

type Command struct {
	Num          int          `json:"num"`
	Folder       string       `json:"folder,omitempty"`
	Route        string       `json:"route,omitempty"`
	Group        string       `json:"group,omitempty"`
	Tool         string       `json:"tool,omitempty"`
	Description  string       `json:"description,omitempty"`
	Options      []Option     `json:"options,omitempty"`
	ReturnType   string       `json:"return_type,omitempty"`
	Attributes   string       `json:"attributes,omitempty"`
	Capabilities string       `json:"capabilities,omitempty"`
	Handlers     []Handler    `json:"handlers,omitempty"`
	Usage        string       `json:"usage,omitempty"`
	Summary      string       `json:"summary,omitempty"`
	Notes        []string     `json:"notes,omitempty"`
	Sorts        []string     `json:"sorts,omitempty"`
	Aliases      []string     `json:"aliases,omitempty"`
	Productions  []*Structure `json:"productions,omitempty"`
	// contains filtered or unexported fields
}

func (*Command) AddCaps

func (c *Command) AddCaps() string

AddCaps for tag {{.AddCaps}}

func (*Command) AliasStr

func (c *Command) AliasStr() string

AliasStr for tag {{.AliasStr}}}

func (*Command) AnyCrud

func (c *Command) AnyCrud() string

func (*Command) BaseTypes

func (c *Command) BaseTypes() string

func (*Command) CapsMapAndArray

func (c *Command) CapsMapAndArray() (map[string]bool, []string)

func (*Command) Clean

func (c *Command) Clean()

func (*Command) Cruds

func (c *Command) Cruds() string

func (*Command) DefaultsApi

func (c *Command) DefaultsApi(showConfig bool) string

DefaultsApi for tag {{.DefaultsApi}}

func (*Command) Deprecated

func (c *Command) Deprecated() string

func (*Command) DeprecatedTransfer

func (c *Command) DeprecatedTransfer() string

func (*Command) EnsConvert1

func (c *Command) EnsConvert1() string

EnsConvert1 for tag {{.EnsConvert1}}

func (*Command) EnsConvert2

func (c *Command) EnsConvert2() string

EnsConvert2 for tag {{.EnsConvert2}}

func (*Command) Enums1

func (c *Command) Enums1() string

Enums1 for tag {{.Enums1}}

func (*Command) Enums2

func (c *Command) Enums2() string

Enums2 for tag {{.Enums2}}

func (*Command) Enums3

func (c *Command) Enums3() string

Enums3 for tag {{.Enums3}}

func (*Command) Example

func (c *Command) Example() string

func (*Command) FirstPositional

func (c *Command) FirstPositional() string

func (*Command) FlagAliases

func (c *Command) FlagAliases() string

func (*Command) FuzzerInits

func (c *Command) FuzzerInits() string

func (*Command) FuzzerSwitches

func (c *Command) FuzzerSwitches() string

----------------------------------------------------------------------

func (*Command) GetGlobs

func (c *Command) GetGlobs() string

func (*Command) GoDefs

func (c *Command) GoDefs() string

GoDefs for tag {{.GoDefs}}

func (*Command) GroupAlias

func (c *Command) GroupAlias(reason string) string

func (*Command) GroupIntro

func (c *Command) GroupIntro(reason string) string

func (*Command) GroupMarkdowns

func (c *Command) GroupMarkdowns(reason, filter string) string

func (*Command) GroupMenu

func (c *Command) GroupMenu(reason string) string

func (*Command) GroupName

func (c *Command) GroupName() string

func (*Command) GroupTitle

func (c *Command) GroupTitle() string

func (*Command) HandlerCode

func (c *Command) HandlerCode() string

func (*Command) HandlerRows

func (c *Command) HandlerRows() string

func (*Command) HasAddrs

func (c *Command) HasAddrs() bool

func (*Command) HasCrud

func (c *Command) HasCrud() bool

func (*Command) HasDeprecated

func (c *Command) HasDeprecated() bool

func (*Command) HasEnums

func (c *Command) HasEnums() bool

func (*Command) HasExample

func (c *Command) HasExample() bool

func (*Command) HasFlagAliases

func (c *Command) HasFlagAliases() bool

func (*Command) HasHidden

func (c *Command) HasHidden() bool

func (*Command) HasNotes

func (c *Command) HasNotes() bool

func (*Command) HasPositionals

func (c *Command) HasPositionals() bool

func (*Command) HasSdkEndpoints

func (c *Command) HasSdkEndpoints() bool

func (*Command) HelpDataModels

func (c *Command) HelpDataModels() string

func (*Command) HelpIntro

func (c *Command) HelpIntro() string
func (c *Command) HelpLinks() string

func (*Command) HelpNotes

func (c *Command) HelpNotes() string

func (*Command) HelpText

func (c *Command) HelpText() string

func (*Command) IsRoute

func (c *Command) IsRoute() bool

func (*Command) OptFields

func (c *Command) OptFields() string

OptFields for tag {{.OptFields}}

func (*Command) PackageComments

func (c *Command) PackageComments() string

func (*Command) Pkg

func (c *Command) Pkg() string

Pkg for tag {{.Pkg}}

func (*Command) ProcessFile

func (item *Command) ProcessFile(source, group, reason string) error

ProcessFile processes a single file, applying the template to it and writing the result to the destination.

func (*Command) ProducedByDescr

func (c *Command) ProducedByDescr() string

func (*Command) ProducedByList

func (c *Command) ProducedByList() string

func (*Command) PyGlobals

func (c *Command) PyGlobals() string

func (*Command) PyOptions

func (c *Command) PyOptions() string

func (*Command) ReadmeFooter

func (c *Command) ReadmeFooter() string

func (*Command) ReadmeName

func (c *Command) ReadmeName() string

func (*Command) RequestOpts

func (c *Command) RequestOpts() string

RequestOpts for tag {{.RequestOpts}}

func (*Command) ReturnTypes

func (c *Command) ReturnTypes() string

----------------------------------------------------------------------

func (*Command) ReturnTypesArray

func (c *Command) ReturnTypesArray() []string

----------------------------------------------------------------------

func (*Command) SdkEndpoints

func (c *Command) SdkEndpoints() string

func (*Command) TestLogs

func (c *Command) TestLogs() string

TestLogs for tag {{.TestLogs}}

func (*Command) TsOptions

func (c *Command) TsOptions() string

func (*Command) TsOptions2

func (c *Command) TsOptions2() string

func (*Command) TsReturns

func (c *Command) TsReturns() string

func (*Command) TsTypes

func (c *Command) TsTypes() string

func (*Command) TypeToGroup

func (c *Command) TypeToGroup(t string) string

func (*Command) YamlGlobals

func (c *Command) YamlGlobals() string

type Facet

type Facet struct {
	DisplayName string          `toml:"display_name" json:"display_name"`
	Name        string          `json:"name"`
	Label       string          `toml:"label" json:"label"`
	MapKey      string          `json:"mapKey" toml:"mapKey"`
	Store       string          `json:"store"` // This will be parsed into StoreName and StoreSource
	StoreName   string          `json:"storeName"`
	StoreSource string          `json:"storeSource"`
	Actions     []string        `toml:"actions" json:"actions"`
	Confirms    map[string]bool `json:"-" toml:"-"` // actions requiring confirmation (parsed from -confirm suffix)
	ViewType    string          `toml:"viewType" json:"viewType"`
	Panel       string          `toml:"panel" json:"panel"`
	Navigate    string          `toml:"navigate" json:"navigate"`
	Attributes  string          `json:"attributes"`
	IsDynamic   bool            `json:"isDynamic" toml:"isDynamic"`

	Disabled   bool `json:"disabled" toml:"disabled"`
	NeedsCalcs bool `json:"needsCalcs" toml:"needsCalcs"`
	PanelChart bool `json:"panelChart" toml:"panelChart"`
	FacetChart bool `json:"facetChart" toml:"facetChart"`
	UseMapKey  bool `json:"useMapKey" toml:"useMapKey"`
	Hidden     bool `json:"hidden" toml:"hidden"`
	Hideable   bool `json:"hideable" toml:"hideable"`
	// contains filtered or unexported fields
}

func (*Facet) Divider

func (f *Facet) Divider() string

func (*Facet) HasDivider

func (f *Facet) HasDivider() bool

func (*Facet) HasViewType

func (f *Facet) HasViewType() bool

func (*Facet) HeaderActionsBe

func (f *Facet) HeaderActionsBe(facet string) string

func (*Facet) IsCustom added in v6.6.5

func (f *Facet) IsCustom() bool

func (*Facet) IsCustomFacet added in v6.6.5

func (f *Facet) IsCustomFacet() bool

func (*Facet) IsCustomPanel added in v6.6.5

func (f *Facet) IsCustomPanel() bool

func (*Facet) IsForm

func (f *Facet) IsForm() bool

func (*Facet) IsTable

func (f *Facet) IsTable() bool

func (*Facet) NavigateTo

func (f *Facet) NavigateTo() string

func (*Facet) NeedsCustomRenderer added in v6.6.5

func (f *Facet) NeedsCustomRenderer() bool

func (*Facet) NormalizeActions

func (f *Facet) NormalizeActions()

NormalizeActions processes any "-confirm" suffix, storing the base action name and a parallel confirmation flag.

func (*Facet) RowActionsBe

func (f *Facet) RowActionsBe(facet string) string

func (*Facet) SingleStore

func (f *Facet) SingleStore() string

func (*Facet) SortFunc

func (f *Facet) SortFunc() string

func (*Facet) ValidateActions

func (f *Facet) ValidateActions() error

func (*Facet) ValidateAll

func (f *Facet) ValidateAll() error

func (*Facet) ValidatePanel added in v6.6.5

func (f *Facet) ValidatePanel() error

func (*Facet) ValidateViewType

func (f *Facet) ValidateViewType() error

type Generator

type Generator struct {
	Against   string   `json:"against"`
	Templates []string `json:"templates"`
}

type Handler

type Handler struct {
	Position float64 `json:"position"`
	Name     string  `json:"name"`
	Option   *Option `json:"option"`
}

func (*Handler) Handler

func (h *Handler) Handler() string

func (*Handler) Test

func (h *Handler) Test() string

type LogMessage

type LogMessage struct {
	MessageType string
	Message     string
}

type Member

type Member struct {
	Name        string `json:"name,omitempty" csv:"name"`
	Type        string `json:"type,omitempty" csv:"type"`
	StrDefault  string `json:"strDefault,omitempty" csv:"strDefault"`
	Attributes  string `json:"attributes,omitempty" csv:"attributes"`
	Section     string `json:"section,omitempty" csv:"section"`
	DocOrder    int    `json:"docOrder,omitempty" csv:"docOrder"`
	Upgrades    string `json:"upgrades,omitempty" csv:"upgrades"`
	Description string `json:"description,omitempty" csv:"description"`
	Label       string `json:"label,omitempty" csv:"label"`
	Num         int    `json:"num"`
	IsArray     bool   `json:"isArray,omitempty"`
	IsPointer   bool   `json:"isPointer,omitempty"`
	// contains filtered or unexported fields
}

func (*Member) Align

func (m *Member) Align() string

func (*Member) BaseType

func (m *Member) BaseType() string

func (*Member) Container

func (m *Member) Container() string

func (*Member) Fmt added in v6.7.0

func (m *Member) Fmt() string

Fmt returns the format hint for this field. If fmt=value is present in attributes, it returns that value; otherwise defaults to the field's Type.

func (*Member) GetColumnLabel added in v6.6.5

func (m *Member) GetColumnLabel() string

GetColumnLabel returns the appropriate column label for this field

func (*Member) GetDetailLabel added in v6.6.5

func (m *Member) GetDetailLabel() string

GetDetailLabel returns the appropriate detail label for this field

func (*Member) GetFormatter

func (m *Member) GetFormatter() string

GetFormatter returns the appropriate formatter string for this field Updated to preserve CSV semantic types and fix boolean field handling

func (*Member) GoName

func (m *Member) GoName() string

func (*Member) GoType

func (m *Member) GoType() string

func (*Member) HasUpgrade

func (m *Member) HasUpgrade() bool

func (*Member) IsAddress

func (m *Member) IsAddress(s *Structure) bool

func (*Member) IsBool

func (m *Member) IsBool() bool

func (*Member) IsCalc

func (m *Member) IsCalc() bool

func (*Member) IsEmbed

func (m *Member) IsEmbed() bool

func (*Member) IsInit

func (m *Member) IsInit() bool

func (*Member) IsItems

func (m *Member) IsItems() bool

func (*Member) IsNoTable

func (m *Member) IsNoTable() bool

func (*Member) IsNoTag

func (m *Member) IsNoTag() bool

func (*Member) IsObject

func (m *Member) IsObject() bool

func (*Member) IsOmitEmpty

func (m *Member) IsOmitEmpty() bool

func (*Member) IsRemoved

func (m *Member) IsRemoved() bool

func (*Member) IsRequired

func (m *Member) IsRequired() bool

func (*Member) IsSimpField

func (m *Member) IsSimpField() bool

func (*Member) IsSortable

func (m *Member) IsSortable() bool

func (*Member) IsString

func (m *Member) IsString() bool

func (*Member) Lower

func (m *Member) Lower() string

func (*Member) LowerSingular

func (m *Member) LowerSingular() string

func (*Member) MarkdownDescription

func (m *Member) MarkdownDescription() string

func (*Member) MarkdownType

func (m *Member) MarkdownType() string

func (*Member) MarshalCode

func (m *Member) MarshalCode() string

MarshalCode writes the writer code for caching this item

func (*Member) MemTsType

func (m *Member) MemTsType() string

func (*Member) NeedsPtr

func (m *Member) NeedsPtr() bool

func (*Member) ReadOnly

func (m *Member) ReadOnly() bool

func (*Member) SortName

func (m *Member) SortName() string

func (*Member) String

func (m *Member) String() string

func (*Member) Tag

func (m *Member) Tag() string

func (*Member) TypeToGroup

func (m *Member) TypeToGroup(t string) string

func (*Member) UiType

func (m *Member) UiType() string

func (*Member) UnmarshalCode

func (m *Member) UnmarshalCode() string

UnmarshalCode writes the reader code for caching this item

func (Member) Validate

func (m Member) Validate() bool

func (*Member) Width

func (m *Member) Width() int64

func (*Member) YamlType

func (m *Member) YamlType() string

type Option

type Option struct {
	Num           int      `json:"num" csv:"num"`
	Folder        string   `json:"folder" csv:"folder"`
	Group         string   `json:"group" csv:"group"`
	Route         string   `json:"route" csv:"route"`
	Tool          string   `json:"tool" csv:"tool"`
	LongName      string   `json:"longName" csv:"longName"`
	HotKey        string   `json:"hotKey" csv:"hotKey"`
	DefVal        string   `json:"def_val" csv:"def_val"`
	Attributes    string   `json:"attributes" csv:"attributes"`
	Handler       float64  `json:"handler,omitempty" csv:"handler"`
	OptionType    string   `json:"option_type" csv:"option_type"`
	DataType      string   `json:"data_type" csv:"data_type"`
	ReturnType    string   `json:"return_type,omitempty" csv:"return_type"`
	Summary       string   `json:"summary,omitempty" csv:"summary"`
	Usage         string   `json:"usage,omitempty" csv:"usage"`
	Capabilities  string   `json:"capabilities,omitempty" csv:"capabilities"`
	Description   string   `json:"description,omitempty" csv:"description"`
	Enums         []string `json:"enums,omitempty"`
	DefaultEnum   string   `json:"default_enum,omitempty"`
	GoName        string   `json:"go_name"`
	GoType        string   `json:"go_type"`
	GoSdkName     string   `json:"go_sdk_name"`
	GoSdkType     string   `json:"go_sdk_type"`
	GoOptionsType string   `json:"go_options_type"`
	// contains filtered or unexported fields
}

func (*Option) AssignReceive

func (op *Option) AssignReceive() string

func (*Option) Clear

func (op *Option) Clear() string

func (*Option) CmdDefault

func (op *Option) CmdDefault() string

func (*Option) CmdTsType

func (op *Option) CmdTsType() string

func (*Option) CobraPart

func (op *Option) CobraPart() string

func (*Option) CobraType

func (op *Option) CobraType() string

func (*Option) Default

func (op *Option) Default() string

func (*Option) DefaultApi

func (op *Option) DefaultApi() string

func (*Option) DeprecatedNotDefault

func (op *Option) DeprecatedNotDefault() string

func (*Option) Deprecator

func (op *Option) Deprecator() string

func (*Option) DeprecatorIsDefault

func (op *Option) DeprecatorIsDefault() string

func (*Option) DeprecatorRep

func (op *Option) DeprecatorRep() string

func (*Option) DescrCaps

func (op *Option) DescrCaps() string

func (*Option) DescriptionEx

func (op *Option) DescriptionEx() string

func (*Option) DocType

func (op *Option) DocType() string

func (*Option) EnsConvert

func (op *Option) EnsConvert() string

func (*Option) Enum1

func (op *Option) Enum1() string

Enum1 for tag {{.Enum1}}

func (*Option) Enum2

func (op *Option) Enum2() string

Enum2 for tag {{.Enum2}}

func (*Option) EnumCases

func (op *Option) EnumCases() string

func (*Option) EnumChoices

func (op *Option) EnumChoices() string

func (*Option) EnumDef

func (op *Option) EnumDef() string

func (*Option) EnumList

func (op *Option) EnumList() string

func (*Option) EnumMap

func (op *Option) EnumMap() string

func (*Option) EnumName

func (op *Option) EnumName() string

func (*Option) EnumNone

func (op *Option) EnumNone() string

func (*Option) EnumTag

func (op *Option) EnumTag(e string) string

func (*Option) EnumTypes

func (op *Option) EnumTypes() []string

func (*Option) FindDeprecator

func (op *Option) FindDeprecator() *Option

func (*Option) FlagAliasTarget

func (op *Option) FlagAliasTarget() string

func (*Option) FuzzerSwitch

func (op *Option) FuzzerSwitch() string

func (*Option) GetBools

func (op *Option) GetBools() string

func (*Option) GetEnums

func (op *Option) GetEnums() string

func (*Option) GetNotFuzzed

func (op *Option) GetNotFuzzed() string

func (*Option) GetOthers

func (op *Option) GetOthers() string

func (*Option) GoDef

func (op *Option) GoDef() string

func (*Option) HasEnumAll

func (op *Option) HasEnumAll() bool

func (*Option) IsAlias

func (op *Option) IsAlias() bool

func (*Option) IsApiHidden

func (op *Option) IsApiHidden() bool

func (*Option) IsArray

func (op *Option) IsArray() bool

func (*Option) IsBool

func (op *Option) IsBool() bool

func (*Option) IsConfig

func (op *Option) IsConfig() bool

func (*Option) IsConfigurableAddr

func (op *Option) IsConfigurableAddr() bool

func (*Option) IsCrud

func (op *Option) IsCrud() bool

func (*Option) IsDeprecated

func (op *Option) IsDeprecated() bool

func (*Option) IsEnum

func (op *Option) IsEnum() bool

func (*Option) IsFlag

func (op *Option) IsFlag() bool

func (*Option) IsFlagAlias

func (op *Option) IsFlagAlias() bool

func (*Option) IsFloat

func (op *Option) IsFloat() bool

func (*Option) IsHidden

func (op *Option) IsHidden() bool

func (*Option) IsMode

func (op *Option) IsMode() bool

func (*Option) IsNullDefault

func (op *Option) IsNullDefault() bool

func (*Option) IsNullDefault2

func (op *Option) IsNullDefault2() bool

func (*Option) IsPositional

func (op *Option) IsPositional() bool

func (*Option) IsRequired

func (op *Option) IsRequired() bool

func (*Option) IsSpecialAddr

func (op *Option) IsSpecialAddr() bool

func (*Option) IsStringLike

func (op *Option) IsStringLike() bool

func (*Option) IsVisible

func (op *Option) IsVisible() bool

func (*Option) IsVisibleDocs

func (op *Option) IsVisibleDocs() bool

func (*Option) JsonTag

func (op *Option) JsonTag() string

func (*Option) Lower

func (op *Option) Lower() string

func (*Option) ModeType

func (op *Option) ModeType() string

func (*Option) OptField

func (op *Option) OptField() string

func (*Option) PreSwitch

func (op *Option) PreSwitch() string

func (*Option) PyHotKey

func (op *Option) PyHotKey() string

func (*Option) RequestOpt

func (op *Option) RequestOpt() string

func (*Option) SdkCoreType

func (op *Option) SdkCoreType() string

func (*Option) SdkEndpoint

func (op *Option) SdkEndpoint() string

func (*Option) SdkIsPublic

func (op *Option) SdkIsPublic() bool

func (*Option) SomeCases

func (op *Option) SomeCases() string

func (Option) String

func (op Option) String() string

func (*Option) Stripped

func (op *Option) Stripped() string

func (*Option) TestLog

func (op *Option) TestLog() string

func (*Option) ToolAssignment

func (op *Option) ToolAssignment() string

func (*Option) ToolParameters

func (op *Option) ToolParameters(forSdk bool) string

func (*Option) ToolTurd

func (op *Option) ToolTurd() string

func (*Option) TsEnumTypes

func (op *Option) TsEnumTypes() []string

func (*Option) TsOption

func (op *Option) TsOption() string

func (Option) Validate

func (op Option) Validate() bool

type Store

type Store struct {
	Source string `json:"source,omitempty" toml:"source"`
	Name   string `json:"name,omitempty" toml:"name"`
	// contains filtered or unexported fields
}

func NewStore

func NewStore(s *Structure, name string) Store

func (*Store) CountOptions

func (s *Store) CountOptions() string

sdk.{{$val}}Options

func (*Store) GetMapKey

func (s *Store) GetMapKey() string

func (*Store) HasActions

func (s *Store) HasActions(facets []Facet) bool

func (*Store) Members

func (s *Store) Members() []Member

func (*Store) NMembers

func (s *Store) NMembers() int

func (*Store) NeedsBuckets

func (s *Store) NeedsBuckets() bool

func (*Store) NeedsCalcs added in v6.6.5

func (s *Store) NeedsCalcs() bool

func (*Store) UseMapKey

func (s *Store) UseMapKey() bool

type Structure

type Structure struct {
	Class        string   `json:"class,omitempty" toml:"class" csv:"class"`
	DisplayName  string   `json:"display_name,omitempty" toml:"display_name"`
	DocGroup     string   `json:"doc_group,omitempty" toml:"doc_group" csv:"doc_group"`
	DocRoute     string   `json:"doc_route,omitempty" toml:"doc_route"`
	DocDescr     string   `json:"doc_descr,omitempty" toml:"doc_descr" csv:"doc_descr"`
	DocNotes     string   `json:"doc_notes,omitempty" toml:"doc_notes" csv:"doc_notes"`
	UiRoute      string   `json:"ui_route,omitempty" toml:"ui_route"`
	UiIcon       string   `json:"ui_icon,omitempty" toml:"ui_icon"`
	ProducedBy   string   `json:"produced_by,omitempty" toml:"produced_by"`
	ContainedBy  string   `json:"contained_by,omitempty" toml:"contained_by"`
	Parent       string   `json:"parent,omitempty" toml:"parent"`
	Children     string   `json:"children,omitempty" toml:"children"`
	CacheAs      string   `json:"cache_as,omitempty" toml:"cache_as"`
	CacheBy      string   `json:"cache_by,omitempty" toml:"cache_by"`
	CacheType    string   `json:"cache_type,omitempty" toml:"cache_type"`
	StoreType    string   `json:"store_type,omitempty" toml:"store_type"`
	DisableGo    bool     `json:"disable_go,omitempty" toml:"disable_go"`
	DisableDocs  bool     `json:"disable_docs,omitempty" toml:"disable_docs"`
	Attributes   string   `json:"attributes,omitempty" toml:"attributes"`
	Sorts        string   `json:"sorts,omitempty" toml:"sorts"`
	FacetOrder   []string `json:"facetOrder,omitempty" toml:"facetOrder"`
	MenuOrder    int      `json:"menuOrder,omitempty" toml:"menuOrder"`
	MenuLabel    string   `json:"menuLabel,omitempty" toml:"menuLabel"`
	MenuPosition string   `json:"menuPosition,omitempty" toml:"menuPosition"`
	Members      []Member `json:"members,omitempty" toml:"members"`
	Facets       []Facet  `json:"facets,omitempty" toml:"facets"`
	Route        string   `json:"-" toml:"-"`
	Producers    []string `json:"-" toml:"-"`
	ChildTabs    []string `json:"-" toml:"-"`
	// contains filtered or unexported fields
}

func ReadTomlFiles added in v6.6.5

func ReadTomlFiles(includeDisabled bool) ([]Structure, error)

ReadTomlFiles reads TOML files from ./code_gen/templates/classDefinitions and returns a slice of Structure objects. If includeDisabled is false, only returns structures where DisableGo is false.

func (*Structure) Addresses

func (s *Structure) Addresses() []string

func (*Structure) AllActions

func (s *Structure) AllActions() []string

func (*Structure) CacheIdStr

func (s *Structure) CacheIdStr() string

func (*Structure) CacheLoc

func (s *Structure) CacheLoc() string

func (*Structure) CalcMembers

func (s *Structure) CalcMembers() []string

func (*Structure) ClassOrClassGroup

func (s *Structure) ClassOrClassGroup() string

func (*Structure) DocSortOrder

func (s *Structure) DocSortOrder() []Member

func (*Structure) EmbedName

func (s *Structure) EmbedName() string

func (*Structure) EmbedType

func (s *Structure) EmbedType() string

func (*Structure) FacetByName

func (s *Structure) FacetByName(facet string) *Facet

func (*Structure) FacetsStr

func (s *Structure) FacetsStr() string

func (*Structure) GroupName

func (s *Structure) GroupName() string

func (*Structure) HandlerStrs

func (s *Structure) HandlerStrs() string

func (*Structure) Handlers

func (s *Structure) Handlers() string

func (*Structure) Handlers_inner

func (s *Structure) Handlers_inner() string

func (*Structure) HasAddresses

func (s *Structure) HasAddresses() bool

func (*Structure) HasAutoname

func (s *Structure) HasAutoname() bool

func (*Structure) HasCrud

func (s *Structure) HasCrud() bool

func (*Structure) HasCrudActions

func (s *Structure) HasCrudActions() bool

func (*Structure) HasCustomFacet

func (s *Structure) HasCustomFacet() bool

func (*Structure) HasCustomPanel

func (s *Structure) HasCustomPanel() bool

func (*Structure) HasCustomRenderers added in v6.6.5

func (s *Structure) HasCustomRenderers() bool

func (*Structure) HasDelete

func (s *Structure) HasDelete() bool

func (*Structure) HasDynamicFacets added in v6.6.5

func (s *Structure) HasDynamicFacets() bool

func (*Structure) HasFacets

func (s *Structure) HasFacets() bool

func (*Structure) HasForms

func (s *Structure) HasForms() bool

func (*Structure) HasNotes

func (s *Structure) HasNotes() bool

func (*Structure) HasRowActions

func (s *Structure) HasRowActions() bool

func (*Structure) HasSorts

func (s *Structure) HasSorts() bool

func (*Structure) HasTimestamp

func (s *Structure) HasTimestamp() bool

func (*Structure) HasTsTypesTypes

func (s *Structure) HasTsTypesTypes() bool

func (*Structure) HasUpdate

func (s *Structure) HasUpdate() bool

func (*Structure) HeaderActionsBe

func (s *Structure) HeaderActionsBe(facet string) string

func (*Structure) IsCachable

func (s *Structure) IsCachable() bool

func (*Structure) IsCacheAsGroup

func (s *Structure) IsCacheAsGroup() bool

func (*Structure) IsFilenameCache

func (s *Structure) IsFilenameCache() bool

func (*Structure) IsMarshalOnly

func (s *Structure) IsMarshalOnly() bool

func (*Structure) ItemFullType

func (s *Structure) ItemFullType() string

func (*Structure) ItemName

func (s *Structure) ItemName() string

func (*Structure) ItemType

func (s *Structure) ItemType() string

func (*Structure) ModelIntro

func (s *Structure) ModelIntro() string

func (*Structure) ModelMembers

func (s *Structure) ModelMembers() string

func (*Structure) ModelNotes

func (s *Structure) ModelNotes() string

func (*Structure) ModelProducers

func (s *Structure) ModelProducers() string

func (*Structure) Name

func (s *Structure) Name() string

func (*Structure) Needs

func (s *Structure) Needs(which string) bool

func (*Structure) NeedsAddress

func (s *Structure) NeedsAddress() bool

func (*Structure) NeedsStatement

func (s *Structure) NeedsStatement() bool

func (*Structure) Num

func (s *Structure) Num() int

func (*Structure) ProcessFile

func (item *Structure) ProcessFile(sourceIn, group, reason string) error

ProcessFile processes a single file, applying the template to it and writing the result to the destination.

func (*Structure) RemoveCallback

func (s *Structure) RemoveCallback() string

func (*Structure) RowActionsBe

func (s *Structure) RowActionsBe(facet string) string

func (*Structure) RowActionsFe

func (s *Structure) RowActionsFe() string

func (*Structure) SortFields

func (s *Structure) SortFields() string

func (*Structure) SortString

func (s *Structure) SortString() string

func (*Structure) SortSwitches

func (s *Structure) SortSwitches() string

func (*Structure) Sorts2

func (s *Structure) Sorts2() string

Sorts2 for tag {{.Sorts2}}

func (*Structure) SortsInstance

func (s *Structure) SortsInstance() string

func (*Structure) Stores

func (s *Structure) Stores() []Store

func (*Structure) String

func (s *Structure) String() string

func (*Structure) TsTypeMembers

func (s *Structure) TsTypeMembers() string

func (*Structure) TsTypesTypes

func (s *Structure) TsTypesTypes() string

func (*Structure) UiHotKey

func (s *Structure) UiHotKey() string

func (*Structure) UiRouteName

func (s *Structure) UiRouteName() string

func (*Structure) UiRouteNum

func (s *Structure) UiRouteNum() uint64

func (*Structure) UniqueActions

func (s *Structure) UniqueActions() []string

returns a list of unique actions from all the facets sorted alphabetically

func (Structure) Validate

func (s Structure) Validate() bool

func (*Structure) Wants

func (s *Structure) Wants(which string) bool

type TemplateMetadata

type TemplateMetadata struct {
	Output string `yaml:"output"`
	Scope  string `yaml:"scope"`
	Group  string `yaml:"group"`
	Route  string `yaml:"route"`
	Reason string `yaml:"reason"`
	Type   string `yaml:"type"`
}

TemplateMetadata holds metadata extracted from template files

type Validater

type Validater interface {
	Validate() bool
}

Jump to

Keyboard shortcuts

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