template

package
v5.1.5-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//CustomConfigPath custom config file path
	CustomConfigPath = "/run/nginx/conf"
)

Functions

func NewNginxTemplate

func NewNginxTemplate(data *model.Nginx, defaultNginxConf string) error

NewNginxTemplate creates a nginx configuration file(nginx.conf)

func NewServerTemplate

func NewServerTemplate(data *ServerContext, filename string) error

NewServerTemplate creates a configuration file for the nginx server module

func NewServerTemplateWithCfgPath

func NewServerTemplateWithCfgPath(data *ServerContext, cfgPath string, filename string) error

NewServerTemplateWithCfgPath creates a configuration file for the nginx server module

func NewUpdateUpsTemplate

func NewUpdateUpsTemplate(data []model.Upstream, tmpl, path string, filename string) error

NewUpdateUpsTemplate creates a configuration file for the nginx upstream module

func NewUpstreamTemplate

func NewUpstreamTemplate(data []model.Upstream, tmpl, filename string) error

NewUpstreamTemplate creates a configuration file for the nginx upstream module

func NewUpstreamTemplateWithCfgPath

func NewUpstreamTemplateWithCfgPath(data []*model.Upstream, tmpl, cfgPath string, filename string) error

NewUpstreamTemplateWithCfgPath creates a configuration file for the nginx upstream module

func Persist

func Persist(tmplFilename string, data interface{}, p string, f string) error

Persist persists the nginx configuration file to disk

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 ServerContext

type ServerContext struct {
	Servers []*model.Server
	Set     option.Config
}

ServerContext ServerContext

type Template

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

Template ...

func NewTemplate

func NewTemplate(fileName 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 interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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