cgi

package
v0.0.0-...-c990d3b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextInterface

type ContextInterface interface {
	// the filesystem output will be written to
	FS() FSInterface
	// the filesystem to be used when loading templates to generate the output
	TemplateFS() embed.FS
	// the command used to generate the output
	CommandString(string) ContextInterface
	// the name of the generation process creating the output
	AttributionString(string) ContextInterface
	// retrieve CommandString value
	GetCommandString() string
	// retrieve AttributionString value
	GetAttributionString() string
	// Given an import, compute what namespace it should use within the current context
	GetImportNamespace(ImportInterface) (string, error)
	// Creates a new context with the file argument's package name and import namespaces applied
	WithinFile(string, ImportSetInterface) ContextInterface
}

interface for the context object of a generation run

type FSInterface

type FSInterface interface {
	Exists(string) bool
	Read(string) (string, error)
	Write(string, string) error
}

type FileInterface

type FileInterface interface {
	Save(ContextInterface) error
}

type ImportInterface

type ImportInterface interface {
	Source() string
	Label() string
	Equals(ImportInterface) bool
	String() string
	DefaultLabel() string
}

type ImportSetInterface

type ImportSetInterface interface {
	ImportMap() map[string]ImportInterface
	GetNamespaceForImport(ImportInterface) string
}

type NodeInterface

type NodeInterface interface {
	Generate(ContextInterface) (NodeOutputInterface, error)
}

type NodeOutputWithTypedDataInterface

type NodeOutputWithTypedDataInterface[D any] interface {
	NodeOutputInterface
	NodeWithData[D]
}

type NodeWithData

type NodeWithData[D any] interface {
	// the data to be used
	Data() D
}

type NodeWithImports

type NodeWithImports interface {
	// set of all imports necessary
	UsedImports() (ImportSetInterface, error)
}

type NodeWithName

type NodeWithName interface {
	// the canonical name of the output data
	Name() string
}

type NodeWithStringOutput

type NodeWithStringOutput interface {
	ToString(ContextInterface) (string, error)
}

type NodeWithTemplate

type NodeWithTemplate interface {
	// primary template to use
	Template() TemplateInterface
	// set of all templates used
	Templates() TemplateSetInterface
}

type NodeWithUntypedData

type NodeWithUntypedData interface {
	UntypedData() any
}

type SignedStringInterface

type SignedStringInterface interface {
	SigningToken() string
	Pattern() *regexp.Regexp
	TokenName() string
	SignString(string) (string, error)
	IsSigned(string) (bool, error)
	Verify(string) (bool, error)
	HasValidSignature(string) (bool, error)
	DocBlock(string) string
	SigningType() cge.SigningType
}

type TemplateInterface

type TemplateInterface interface {
	FullName() string
	NameWithExtension() string
}

type TemplateSetInterface

type TemplateSetInterface interface {
	Names() []string
}

type TypeInterface

type TypeInterface interface {
	Name() string
	Import() ImportInterface
}

Jump to

Keyboard shortcuts

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