template

package
v5.1.10-release+incomp... Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 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

func (*NginxConfigFileTemplete) WriteServerAndUpstream

func (n *NginxConfigFileTemplete) WriteServerAndUpstream(first bool, c option.Config, configType, tenant string, server *model.Server, upstream *model.Upstream) error

WriteServerAndUpstream wriete server

func (*NginxConfigFileTemplete) WriteUpstream

func (n *NginxConfigFileTemplete) WriteUpstream(set option.Config, tenant string, upstrems ...*model.Upstream) error

WriteUpstream write upstream config

type NginxServerContext

type NginxServerContext struct {
	Server *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)

Jump to

Keyboard shortcuts

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