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) }
Output:
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) }
Output:
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 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 ¶
type Object ¶
type Object struct { Field string `json:"field,omitempty"` Key string `json:"key,omitempty"` Value interface{} `json:"value,omitempty"` Type string `json:"type,omitempty"` JSONKey string `json:"jsonKey,omitempty"` Example string `json:"example,omitempty"` }
Object object field message
func GetFieldsAndValue ¶
GetFieldsAndValue get object field value type and so on
Click to show internal directories.
Click to hide internal directories.