template

package
v0.0.0-...-e842eea Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitiliazed    = fmt.Errorf("already initialized")
	ErrNotInitialized = fmt.Errorf("not initialized")
)

Functions

func Funcs

func Funcs(config config) template.FuncMap

Types

type Option

type Option func(*Options)

func WithAddress

func WithAddress(addr string) Option

func WithPort

func WithPort(port int) Option

type Options

type Options struct {
	Address string
	Port    int
}

func (*Options) Apply

func (o *Options) Apply(options ...Option)

type Set

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

func NewSet

func NewSet() *Set

func (*Set) Contains

func (s *Set) Contains(key string) bool

func (*Set) Delete

func (s *Set) Delete(key string)

func (*Set) Keys

func (s *Set) Keys() []string

func (*Set) Len

func (s *Set) Len() int

func (*Set) Put

func (s *Set) Put(key string, value []byte)

func (*Set) Value

func (s *Set) Value(key string) []byte

todo: not save for modification

type Template

type Template struct {
	Source         string
	Destination    string
	Mode           os.FileMode
	Backup         bool
	Command        string
	CommandTimeout time.Duration
	// contains filtered or unexported fields
}

func New

func New(source, destination, command string, mode os.FileMode, backup bool, commandTimeout time.Duration) *Template

func (*Template) Initialize

func (t *Template) Initialize(options ...Option) error

func (*Template) Process

func (t *Template) Process(ctx context.Context) error

Jump to

Keyboard shortcuts

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