codegen

package
v0.744.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prelude

func Prelude() *CommentGroup

Prelude creates a comment group indicating a generated file that shouldn't be edited.

func Tag

func Tag(tags map[string]string) *ast.BasicLit

TODO: Make this more robust (e.g., What about tags containing newlines?)

Types

type FileSystemWriter

type FileSystemWriter interface {
	Create(name string) (io.WriteCloser, error)
}

A FileSystemWriter provides the means to write files into a collection of named files.

type MemoryFileSystemWriter

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

MemoryFileSystemWriter allows writing into an in-memory map.

func NewMemoryFileSystemWriter added in v0.666.0

func NewMemoryFileSystemWriter() *MemoryFileSystemWriter

func (*MemoryFileSystemWriter) Create added in v0.666.0

func (w *MemoryFileSystemWriter) Create(name string) (io.WriteCloser, error)

Create opens a file for writing.

func (*MemoryFileSystemWriter) Get

func (w *MemoryFileSystemWriter) Get(name string) []byte

Get returns the bytes of the named file.

type OSFileSystemWriter

type OSFileSystemWriter struct {
	Root string
}

OSFileSystemWriter allows writing into the OS filesystem.

func (*OSFileSystemWriter) Create

func (w *OSFileSystemWriter) Create(name string) (io.WriteCloser, error)

Create opens an OS file for writing.

Jump to

Keyboard shortcuts

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