Documentation ¶
Index ¶
- Variables
- func NewNginxTemplate(data *model.Nginx, defaultNginxConf string) error
- func NewServerTemplate(data *ServerContext, filename string) error
- func NewServerTemplateWithCfgPath(data *ServerContext, cfgPath string, filename string) error
- func NewUpdateUpsTemplate(data []model.Upstream, tmpl, path string, filename string) error
- func NewUpstreamTemplate(data []model.Upstream, tmpl, filename string) error
- func NewUpstreamTemplateWithCfgPath(data []*model.Upstream, tmpl, cfgPath string, filename string) error
- func Persist(tmplFilename string, data interface{}, p string, f string) error
- type BufferPool
- type ServerContext
- type Template
Constants ¶
This section is empty.
Variables ¶
var (
//CustomConfigPath custom config file path
CustomConfigPath = "/run/nginx/conf"
)
Functions ¶
func NewNginxTemplate ¶
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 ¶
NewUpdateUpsTemplate creates a configuration file for the nginx upstream module
func NewUpstreamTemplate ¶
NewUpstreamTemplate creates a configuration file for the nginx upstream module
Types ¶
type BufferPool ¶
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 ¶
ServerContext ServerContext
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template ...
func NewTemplate ¶
NewTemplate returns a new Template instance or an error if the specified template file contains errors