# README
= GoAS3Parse
AS3 parsing module for Go
== Status
This project currently supports parsing a raw AS3 declaration into a list of Go structs. It can parse a single declaration into a list of Tenant, Application, and Virtual Server objects, including as many sub properties/objects as possible. Focus is on LTM configuration for HTTPS virtual servers.
== Usage
[source,go]
import ( "encoding/json" "os" as3parse "github.com/allyn-bottorff/as3"
)
// Read in a JSON object file and store the contents as a map[string]interface{} func readJson(filePath string) map[string]interface{} { f, err := os.ReadFile(filePath) if err != nil { log.Fatal("Failed to read AS3 JSON file.") }
jsonMap := make(map[string]interface{})
json.Unmarshal(f, &jsonMap)
return jsonMap
}
func main() {
// Create a map[string]interface{}
jsonMap := readJson("./path-to-as3.json")
// Fill the AS3 Declaration with the parsed contents of the AS3 json
dec := as3parse.ParseDec(jsonMap)
// Print out basic statistic about the declaration
dec.Summarize()
}
# Functions
Parse application-specific fields (no nested objects).
Parse declaration-specific fields.
No description provided by the author
No description provided by the author
Parse tenant-specific fields (no nested objects).
No description provided by the author
# Structs
AS3 Application.
AS3 Declaration, reformatted to use lists of object types instead of individual named objects.
No description provided by the author
No description provided by the author
No description provided by the author
AS3 Tenant, reformatted to use lists of object types instead of individual named objects.
This struct is a superset representing the possible keys for a virtual VirtualServer including Service_HTTP, Service_HTTPS, Service_TCP, Service_L4.