template

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: LGPL-3.0 Imports: 17 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) ClearByTenantEnv added in v1.1.0

func (n *NginxConfigFileTemplete) ClearByTenantEnv(tenantEnv string) error

ClearByTenantEnv clear tenant env 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, tenantEnv 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)

Jump to

Keyboard shortcuts

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