gen

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PartTemplate = `package day{{ printf "%02d" .Day }}

func Part{{ .Part }}(useSample bool) int {
	
	return 0
}
`

	MainTemplate = `` /* 449-byte string literal not displayed */

)

Variables

View Source
var (
	ErrNoModule        = errors.New("no go.mod found")
	ErrFileExists      = errors.New("unable to create file as it already exists")
	ErrNoValidTemplate = errors.New("no valid template found")
)

Functions

This section is empty.

Types

type Generator

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

func New

func New(opts ...Option) (*Generator, error)

func (*Generator) Generate

func (g *Generator) Generate(day int, year int) error

type Option

type Option func(*Generator)

func WithBaseURL added in v0.0.2

func WithBaseURL(baseURL string) Option

func WithForce

func WithForce(force bool) Option

func WithMainTemplateFile

func WithMainTemplateFile(tmpl string) Option

func WithModuleName

func WithModuleName(name string) Option

func WithPartTemplateFile

func WithPartTemplateFile(tmpl string) Option

func WithPath

func WithPath(path string) Option

func WithSession added in v0.0.2

func WithSession(session string) Option

Jump to

Keyboard shortcuts

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