cv

package
v0.0.0-...-4cc6d5b Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidContent             = errors.New("configuration format is not valid")
	ErrInvalidConfigurationFormat = errors.New("configuration format does not match the schema")
)
View Source
var (
	ErrNonParsableTemplate = errors.New("HTML template cannot be parsed")
	ErrFoundInvalidTag     = errors.New("found invalid tag in the HTML template")
	ErrMismatchAppVersion  = errors.New("template does not support the current app version")
)

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// contains filtered or unexported fields
}

func NewConfiguration

func NewConfiguration(ctx context.Context, config ConfigurationConfig) (*Configuration, error)

func (*Configuration) Data

func (c *Configuration) Data() *types.Schema

func (*Configuration) Validate

func (c *Configuration) Validate() error

type ConfigurationConfig

type ConfigurationConfig struct {
	// ConfigPath is the path to the configuration file.
	ConfigPath string `validate:"required"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	appVersion string,
	configPath string,
	outputPath string,
) (*Handler, error)

func (*Handler) Generate

func (g *Handler) Generate(ctx context.Context) error

type Template

type Template struct {
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(ctx context.Context, config TemplateConfig) (*Template, error)

func (*Template) Process

func (t *Template) Process(config *types.Schema) ([]byte, error)

func (*Template) Validate

func (t *Template) Validate() error

type TemplateConfig

type TemplateConfig struct {
	// AppVersion is the current version of the application.
	AppVersion string `validate:"required,semver"`

	// TemplatePath is the path to the HTML template.
	TemplatePath string `validate:"required"`

	// Customizer is the manual customization that will be added to
	// the template.
	Customizer types.Customizer
}

Jump to

Keyboard shortcuts

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