Documentation
¶
Overview ¶
Example (Nginxconf_Parse) ¶
package main import ( "fmt" "github.com/caas-one/nginxconf" ) func main() { path := "./nginx.conf" global, err := nginxconf.Parse(path) if err != nil { panic(err) } fmt.Println(global) }
Example (Nginxconf_RenderToString) ¶
package main import ( "fmt" "github.com/caas-one/nginxconf" ) func main() { path := "./nginx.conf" global, err := nginxconf.Parse(path) if err != nil { panic(err) } result, err := nginxconf.RenderToString(global) if err != nil { panic(err) } fmt.Println(result) }
Index ¶
- func GetFields(object interface{}) (interface{}, error)
- func Parse(filePath string) (*core.Global, error)
- func ParseToConfigs(filePath string) (*core.CrossplaneOut, error)
- func ParseToJSON(filePath string) (string, error)
- func RenderToBytes(tb core.TemplateBlock) ([]byte, error)
- func RenderToString(tb core.TemplateBlock) (string, error)
- type Object
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFields ¶
func GetFields(object interface{}) (interface{}, error)
GetFields get fields type eg
func Parse ¶
Parse parse nginx conf form file path
func ParseToConfigs ¶
func ParseToConfigs(filePath string) (*core.CrossplaneOut, error)
ParseToConfigs parse nginx conf to crossplane configs
func ParseToJSON ¶
ParseToJSON parse nginx conf to json
func RenderToBytes ¶
func RenderToBytes(tb core.TemplateBlock) ([]byte, error)
RenderToBytes render module to nginx conf
func RenderToString ¶
func RenderToString(tb core.TemplateBlock) (string, error)
RenderToString render module to nginx conf
Types ¶
Source Files
¶
- fields.go
- parse.go
- py_parse.go
- render.go
Click to show internal directories.
Click to hide internal directories.