Back to godoc.org

Package template

v5.2.0-release+incompa...
Latest Go to latest

The latest major version is .

Published: Apr 16, 2020 | License: LGPL-3.0 | Module: github.com/goodrain/rainbond

Index

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 NginxConfigFileTemplete

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

NginxConfigFileTemplete nginx config file manage write by templete

func NewNginxConfigFileTemplete

func NewNginxConfigFileTemplete() (*NginxConfigFileTemplete, error)

NewNginxConfigFileTemplete new nginx config file manage

func (*NginxConfigFileTemplete) ClearByTenant

func (n *NginxConfigFileTemplete) ClearByTenant(tenant string) error

ClearByTenant clear tenant config

func (*NginxConfigFileTemplete) GetConfigFileDirPath

func (n *NginxConfigFileTemplete) GetConfigFileDirPath() string

GetConfigFileDirPath get configfile dir path

func (*NginxConfigFileTemplete) NewNginxTemplate

func (n *NginxConfigFileTemplete) NewNginxTemplate(data *model.Nginx) error

NewNginxTemplate new nginx main config

func (*NginxConfigFileTemplete) WriteServer

func (n *NginxConfigFileTemplete) WriteServer(c option.Config, configtype, tenant string, servers ...*model.Server) error

WriteServer write server config

type NginxServerContext

type NginxServerContext struct {
	Servers     []*model.Server
	TCPBackends []*model.Server
	UDPBackends []*model.Server
	Set         option.Config
}

NginxServerContext nginx server config

type NginxUpstreamContext

type NginxUpstreamContext struct {
	Upstream *model.Upstream
	Set      option.Config
}

NginxUpstreamContext nginx upstream config

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)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier