template

package
v0.0.0-...-0db023b Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(src map[string]string) config.Configuration

ReadConfig obtains the configuration defined by the user merged with the defaults.

Types

type BufferPool

type BufferPool struct {
	sync.Pool
}

BufferPool defines a Pool of Buffers

func NewBufferPool

func NewBufferPool(s int) *BufferPool

NewBufferPool creates a new BufferPool with a custom buffer size

func (*BufferPool) Get

func (bp *BufferPool) Get() *bytes.Buffer

Get returns a Buffer from the pool

func (*BufferPool) Put

func (bp *BufferPool) Put(b *bytes.Buffer)

Put resets ans returns a Buffer to the pool

type Template

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

Template ...

func NewTemplate

func NewTemplate(file string) (*Template, error)

NewTemplate returns a new Template instance or an error if the specified template file contains errors

func (*Template) Write

func (t *Template) Write(conf config.TemplateConfig) ([]byte, error)

Write populates a buffer using a template with NGINX configuration and the servers and upstreams created by Ingress rules

type TemplateWriter

type TemplateWriter interface {
	Write(conf config.TemplateConfig) ([]byte, error)
}

TemplateWriter is the interface to render a template

Jump to

Keyboard shortcuts

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