Documentation
¶
Overview ¶
Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
Index ¶
- func IsProdRegion(s string, system vespa.System) bool
- func ParseNodeCount(s string) (int, int, error)
- func Replace(r io.Reader, parentName, name string, data interface{}) (string, error)
- func ReplaceRaw(rawXML, name, value string) string
- type Container
- type Content
- type Deployment
- type Instance
- type Nodes
- type Prod
- type Region
- type Resources
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsProdRegion ¶
IsProdRegion returns whether string s is a valid production region.
func ParseNodeCount ¶
ParseNodeCount parses a node count range from string s.
func Replace ¶
Replace looks for an element name in the XML read from reader r, appearing inside a element named parentName.
Any matching elements found are replaced with data. If parentName contains an ID selector, e.g. "email#my-id", only the elements inside the parent element with the attribute id="my-id" are replaced.
If data is nil, any matching elements are removed instead of replaced.
func ReplaceRaw ¶
ReplaceRaw finds all elements of name in rawXML and replaces their contents with value.
Types ¶
type Deployment ¶
type Deployment struct { Root xml.Name `xml:"deployment"` Version string `xml:"version,attr"` Instance []Instance `xml:"instance"` Prod Prod `xml:"prod"` // contains filtered or unexported fields }
Deployment represents the contents of a deployment.xml file.
var DefaultDeployment Deployment
func ReadDeployment ¶
func ReadDeployment(r io.Reader) (Deployment, error)
ReadDeployment reads deployment.xml from reader r.
func (*Deployment) Replace ¶
func (s *Deployment) Replace(parentName, name string, data interface{}) error
Replace replaces any elements of name found under parentName with data.
func (Deployment) String ¶
func (d Deployment) String() string
type Resources ¶
type Resources struct { Vcpu string `xml:"vcpu,attr"` Memory string `xml:"memory,attr"` Disk string `xml:"disk,attr"` }
func ParseResources ¶
ParseResources parses nodes resources from string s.
type Services ¶
type Services struct { Root xml.Name `xml:"services"` Container []Container `xml:"container"` Content []Content `xml:"content"` // contains filtered or unexported fields }
Services represents the contents of a services.xml file.
func ReadServices ¶
ReadServices reads services.xml from reader r.