templateUtils

package
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignPriority

func AssignPriority(index int) int

AssignPriority returns a priority for firewall rule with basePriority + index

func EnableAccNet

func EnableAccNet(vmSize string) string

EnableAccNet will check if accelerated networking can be enabled based on conditions specified here https://azure.microsoft.com/en-us/updates/accelerated-networking-in-expanded-preview/ we will look only at VM sizes, since all regions are supported now all reasonable operating systems

func ExtractNetmaskFromCIDR

func ExtractNetmaskFromCIDR(cidr string) string

ExtractNetmaskFromCIDR extracts the netmask from the CIDR notation.

func ExtractTargetPorts

func ExtractTargetPorts(loadBalancers []*pb.LBcluster) []int

ExtractTargetPorts extracts target ports defined inside the role in the LoadBalancer.

func IsMissing

func IsMissing[K comparable](item K, items []K) bool

IsMissing checks if item is missing in the list of items.

func LoadTemplate added in v0.3.2

func LoadTemplate(tplFile string) (*template.Template, error)

LoadTemplate creates template instance with auxiliary functions from specified template.

func ProtocolNameToAzureProtocolString

func ProtocolNameToAzureProtocolString(protocol string) string

ProtocolNameToAzureProtocolString returns string constants for transport protocols

func ProtocolNameToOCIProtocolNumber

func ProtocolNameToOCIProtocolNumber(protocol string) int

ProtocolNameToOCIProtocolNumber translates between a string version of a protocol to a number version that can be used within OCI. More info in the following link: https://docs.oracle.com/en-us/iaas/tools/terraform-provider-oci/4.96/docs/r/core_security_list.html

Types

type Templates

type Templates struct {
	Directory string
}

directory - output directory MUST be relative to base directory, i.e. services/terraformer/etc

func (Templates) Generate

func (t Templates) Generate(tpl *template.Template, outputFile string, d interface{}) error

creates a file from template and saves it to the directory specified in Templates the directory MUST be relative to base directory, i.e. services/terraformer/templates

func (Templates) GenerateToString

func (t Templates) GenerateToString(tpl *template.Template, d interface{}) (string, error)

creates a file from template and returns it as a string variable returns error if not successful, generated template as a string and nil otherwise

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL