util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"

Variables

This section is empty.

Functions

func ApplyToGraphmanTarget

func ApplyToGraphmanTarget(path string, username string, password string, target string, encpass string) error

func BuildCWPBundle

func BuildCWPBundle(cwps map[string]string) ([]byte, error)

func BuildCustomListenPortBundle

func BuildCustomListenPortBundle(gw *securityv1.Gateway) ([]byte, error)

func BuildDefaultListenPortBundle

func BuildDefaultListenPortBundle() ([]byte, error)

func CloneRepository

func CloneRepository(url string, username string, token string, branch string, name string) (string, error)

func CompressGraphmanBundle

func CompressGraphmanBundle(path string) ([]byte, error)

func Contains

func Contains(arr []string, str string) bool

Contains returns true if string array contains string

func DefaultLabels

func DefaultLabels(name string, additionalLabels map[string]string) map[string]string

func GetOperatorNamespace

func GetOperatorNamespace() (string, error)

GetOperatorNamespace returns the namespace of the operator pod

func GetWatchNamespace

func GetWatchNamespace() (string, error)

GetWatchNamespace returns the namespace the operator should be watching for changes

func RestCall

func RestCall(method string, URL string, insecureSkipVerify bool, headers map[string]string, contentType string, data []byte, username string, password string) ([]byte, error)

func Unzip

func Unzip(src string, dest string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

Types

type Bundle

type Bundle struct {
	XMLName    xml.Name   `xml:"l7:Bundle"`
	XMLNS      string     `xml:"xmlns:l7,attr"`
	References References `xml:"l7:References"`
	Mappings   Mappings   `xml:"l7:Mappings"`
}

type ClusterProperty

type ClusterProperty struct {
	ID    string `xml:"id,attr"`
	Name  string `xml:"l7:Name"`
	Value string `xml:"l7:Value"`
}

type EnabledCipherSuites

type EnabledCipherSuites struct {
	StringValue []string `xml:"l7:StringValue"`
}

type EnabledFeatures

type EnabledFeatures struct {
	StringValue []string `xml:"l7:StringValue"`
}

type EnabledVersions

type EnabledVersions struct {
	StringValue []string `xml:"l7:StringValue"`
}

type Item

type Item struct {
	Name     string   `xml:"l7:Name"`
	ID       string   `xml:"l7:Id"`
	Type     string   `xml:"l7:Type"`
	Resource Resource `xml:"l7:Resource"`
}

type ListenPort

type ListenPort struct {
	ID              string          `xml:"id,attr"`
	Name            string          `xml:"l7:Name"`
	Enabled         string          `xml:"l7:Enabled"`
	Protocol        string          `xml:"l7:Protocol"`
	Port            string          `xml:"l7:Port"`
	EnabledFeatures EnabledFeatures `xml:"l7:EnabledFeatures"`
	TlsSettings     *TlsSettings    `xml:"l7:TlsSettings"`
	Properties      Properties      `xml:"l7:Properties"`
}

type Mapping

type Mapping struct {
	Action     string     `xml:"action,attr"`
	SrcId      string     `xml:"srcId,attr"`
	Type       string     `xml:"type,attr"`
	Properties Properties `xml:"l7:Properties"`
}

type Mappings

type Mappings struct {
	Mapping []Mapping `xml:"l7:Mapping"`
}

type PrivateKeyReference

type PrivateKeyReference struct {
	ID          string `xml:"id,attr"`
	ResourceURI string `xml:"resourceUri,attr"`
}

type Properties

type Properties struct {
	Property []Property `xml:"l7:Property"`
}

type Property

type Property struct {
	Key          string `xml:"key,attr"`
	StringValue  string `xml:"l7:StringValue,omitempty"`
	BooleanValue bool   `xml:"l7:BooleanValue,omitempty"`
}

type References

type References struct {
	Item []Item `xml:"l7:Item"`
}

type Resource

type Resource struct {
	ClusterProperty *ClusterProperty `xml:"l7:ClusterProperty,omitempty"`
	ListenPort      *ListenPort      `xml:"l7:ListenPort,omitempty"`
}

type TlsSettings

type TlsSettings struct {
	ClientAuthentication string              `xml:"l7:ClientAuthentication"`
	PrivateKeyReference  PrivateKeyReference `xml:"l7:PrivateKeyReference"`
	EnabledVersions      EnabledVersions     `xml:"l7:EnabledVersions"`
	EnabledCipherSuites  EnabledCipherSuites `xml:"l7:EnabledCipherSuites"`
	UseCipherSuitesOrder bool                `xml:"l7:UseCipherSuitesOrder"`
	Properties           Properties          `xml:"l7:Properties"`
}

Jump to

Keyboard shortcuts

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