util

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"

Variables

This section is empty.

Functions

func ApplyGraphmanBundle added in v1.0.2

func ApplyGraphmanBundle(username string, password string, target string, encpass string, bundle []byte) error

func ApplyToGraphmanTarget

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

func BuildCWPBundle

func BuildCWPBundle(cwps []securityv1.Property) ([]byte, string, error)

func BuildCustomListenPortBundle

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

func BuildDefaultListenPortBundle

func BuildDefaultListenPortBundle() ([]byte, string, error)

func CloneRepository

func CloneRepository(url string, username string, token string, branch string, tag string, remoteName string, name string, vendor 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 ConvertOpaqueMapToGraphmanBundle added in v1.0.2

func ConvertOpaqueMapToGraphmanBundle(secrets []GraphmanSecret) ([]byte, error)

func ConvertX509ToGraphmanBundle added in v1.0.2

func ConvertX509ToGraphmanBundle(keys []GraphmanKey) ([]byte, error)

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 CachedSyncRequest added in v1.0.2

type CachedSyncRequest struct {
	SyncRequest
	// contains filtered or unexported fields
}

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 GraphmanKey added in v1.0.2

type GraphmanKey struct {
	Name string `json:"name,omitempty"`
	Crt  string `json:"crt,omitempty"`
	Key  string `json:"key,omitempty"`
	Port string `json:"port,omitempty"`
}

type GraphmanSecret added in v1.0.2

type GraphmanSecret struct {
	Name                 string `json:"name,omitempty"`
	Secret               string `json:"secret,omitempty"`
	Description          string `json:"description,omitempty"`
	VariableReferencable bool   `json:"variableReferencable,omitempty"`
}

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 SyncCache added in v1.0.2

type SyncCache struct {
	// contains filtered or unexported fields
}

func NewSyncCache added in v1.0.2

func NewSyncCache(cleanupInterval time.Duration) *SyncCache

func (*SyncCache) Delete added in v1.0.2

func (sc *SyncCache) Delete(requestName string)

func (*SyncCache) Read added in v1.0.2

func (sc *SyncCache) Read(requestName string) (SyncRequest, error)

func (*SyncCache) Update added in v1.0.2

func (sc *SyncCache) Update(sr SyncRequest, expiryTimestamp int64)

type SyncRequest added in v1.0.2

type SyncRequest struct {
	RequestName string
	Attempts    int
}

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