types

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CFConfigIngress added in v0.0.11

type CFConfigIngress struct {
	Hostname      string                 `yaml:"hostname,omitempty"`
	Path          string                 `yaml:"path,omitempty"`
	Service       string                 `yaml:"service,omitempty"`
	OriginRequest *CFConfigOriginRequest `yaml:"originRequest,omitempty"`
}

type CFConfigOriginRequest added in v0.0.11

type CFConfigOriginRequest struct {
	NoTLSVerify    bool   `yaml:"noTLSVerify" json:"noTLSVerify"`
	HttpHostHeader string `yaml:"httpHostHeader,omitempty"`
}

type CFConfigYaml added in v0.0.11

type CFConfigYaml struct {
	Tunnel          string            `yaml:"tunnel"`
	CredentialsFile string            `yaml:"credentials-file"`
	Ingress         []CFConfigIngress `yaml:"ingress"`
}

type CFController

type CFController interface {
	WithComponent(component string, fns ...func(CFController)) CFController
	RegisterShutdown(sfn func()) func()
	Shutdown() error
	Log() *zerolog.Logger
	SetLog(*zerolog.Logger)
	Cfg() *CFControllerConfig
	SetCfg(*CFControllerConfig)
	Rest() RestClients
	K8sData() *K8sData
	Context() context.Context
	CancelFunc() context.CancelFunc
}

type CFControllerCloudflareConfig added in v0.1.0

type CFControllerCloudflareConfig struct {
	ApiUrl                   string
	ApiToken                 string
	AccountId                string
	TunnelConfigMapNamespace string
}

type CFControllerConfig added in v0.0.11

type CFControllerConfig struct {
	KubeConfigFile         string
	PresetNamespaces       []string
	Identity               string
	NoCloudFlared          bool
	Version                string
	Debug                  bool
	ShowVersion            bool
	RunningInstanceDir     string
	CloudFlaredFname       string
	ChannelSize            int
	ClusterName            string
	RestartDelay           time.Duration
	ConfigMapLabelSelector string
	CloudFlare             CFControllerCloudflareConfig
	Leader                 struct {
		Name          string
		Namespace     string
		LeaseDuration time.Duration
		RenewDeadline time.Duration
		RetryPeriod   time.Duration
	}
}

type CFEndpointMapping added in v0.0.11

type CFEndpointMapping struct {
	Path     string
	External string
	Internal string
}

type CFTunnelParameter added in v0.0.11

type CFTunnelParameter struct {
	Name      string
	Namespace string
}

func (*CFTunnelParameter) K8SConfigMapName added in v0.0.11

func (cft *CFTunnelParameter) K8SConfigMapName() K8SResourceName

func (*CFTunnelParameter) K8SSecretName added in v0.0.11

func (cft *CFTunnelParameter) K8SSecretName() K8SResourceName

func (*CFTunnelParameter) ObjectMeta added in v0.0.11

func (cft *CFTunnelParameter) ObjectMeta(ometa *metav1.ObjectMeta) metav1.ObjectMeta

type CFTunnelParameterWithID added in v0.0.11

type CFTunnelParameterWithID struct {
	CFTunnelParameter
	ID uuid.UUID
}

type CFTunnelSecret added in v0.0.11

type CFTunnelSecret struct {
	AccountTag   string    `json:"AccountTag"`
	TunnelSecret string    `json:"TunnelSecret"`
	TunnelID     uuid.UUID `json:"TunnelID"`
}

type ClassIngressAnnotationMapping added in v0.1.0

type ClassIngressAnnotationMapping struct {
	Hostname   string
	Schema     string
	HostHeader *string
	Path       string
}

hostname/schema[/hostheader]|path,

type K8SClient

type K8SClient[R runtime.Object, L K8SItem[R]] interface {
	Watch(ctx context.Context, options metav1.ListOptions) (watch.Interface, error)
	List(ctx context.Context, options metav1.ListOptions) (K8SList[R, L], error)
}

type K8SItem

type K8SItem[R runtime.Object] interface {
	GetUID() types.UID
	GetItem() R
}

type K8SList

type K8SList[R runtime.Object, T K8SItem[R]] interface {
	GetItems() []T
}

type K8SResourceName added in v0.0.11

type K8SResourceName struct {
	Namespace string
	Name      string
	FQDN      string
}

func FromFQDN added in v0.0.11

func FromFQDN(fqdn string, ns string) K8SResourceName

type K8sData

type K8sData struct {
	// Get              func() []TunnelConfigMap
	TunnelConfigMaps TunnelConfigMaps
	Namespaces       Watcher[*corev1.Namespace] // [corev1.Namespace, *corev1.Namespace, WatcherBindingNamespace, WatcherBindingNamespaceClient]
}

type RestClients

type RestClients interface {
	// cfc *CFController
	// // Cf  *cfapi.RESTClient
	// cfsLock sync.Mutex
	// cfs     map[string]*cfapi.RESTClient
	CFClientWithoutZoneID() (*cfapi.RESTClient, error)
	GetCFClientForDomain(string) (*cfapi.RESTClient, error)
	K8s() *kubernetes.Clientset
	SetK8s(*kubernetes.Clientset)
}

type StackIngressAnnotationMapping added in v0.1.0

type StackIngressAnnotationMapping struct {
	Schema      string
	Hostname    string
	InternPort  int
	HostHeader  *string
	ExtHostName string
	Path        string
}

schema/hostname/int-port/hostheader/ext-host|path,

type SvcAnnotationMapping added in v0.1.0

type SvcAnnotationMapping struct {
	PortName string
	Schema   string
	Path     string
	Order    int
}

type TunnelConfigMaps

type TunnelConfigMaps interface {
	Register(func([]*corev1.ConfigMap, watch.Event)) func()
	Get() []*corev1.ConfigMap

	UpsertConfigMap(cfc CFController, tparam *CFTunnelParameter, kind string, meta *metav1.ObjectMeta, cfcis []CFConfigIngress) error
	RemoveConfigMap(cfc CFController, kind string, meta *metav1.ObjectMeta)
}

type WatchFunc

type WatchFunc[RO runtime.Object] func(state []RO, ev watch.Event)

type Watcher

type Watcher[RO runtime.Object] interface {
	Start() error
	Stop()
	GetState() []RO
	GetContext() context.Context
	RegisterEvent(WatchFunc[RO]) func()
}

type WatcherBindingConfigMap

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

func (WatcherBindingConfigMap) GetItem

func (WatcherBindingConfigMap) GetUID

func (nl WatcherBindingConfigMap) GetUID() types.UID

type WatcherBindingConfigMapClient

type WatcherBindingConfigMapClient struct {
	Cif v1.ConfigMapInterface
}

func (WatcherBindingConfigMapClient) List

func (WatcherBindingConfigMapClient) Watch

type WatcherBindingConfigMapList

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

func (*WatcherBindingConfigMapList) GetItems

type WatcherBindingIngress

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

func (WatcherBindingIngress) GetItem

func (nl WatcherBindingIngress) GetItem() *netv1.Ingress

func (WatcherBindingIngress) GetUID

func (nl WatcherBindingIngress) GetUID() types.UID

type WatcherBindingIngressClient

type WatcherBindingIngressClient struct {
	Cif v1.IngressInterface
}

func (WatcherBindingIngressClient) List

func (WatcherBindingIngressClient) Watch

type WatcherBindingIngressList

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

func (*WatcherBindingIngressList) GetItems

type WatcherBindingNamespace

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

func (WatcherBindingNamespace) GetItem

func (WatcherBindingNamespace) GetUID

func (nl WatcherBindingNamespace) GetUID() types.UID

type WatcherBindingNamespaceClient

type WatcherBindingNamespaceClient struct {
	Nif v1.NamespaceInterface
}

func (WatcherBindingNamespaceClient) List

func (WatcherBindingNamespaceClient) Watch

type WatcherBindingNamespaceList

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

func (*WatcherBindingNamespaceList) GetItems

type WatcherBindingService

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

func (WatcherBindingService) GetItem

func (nl WatcherBindingService) GetItem() *corev1.Service

func (WatcherBindingService) GetUID

func (nl WatcherBindingService) GetUID() types.UID

type WatcherBindingServiceClient

type WatcherBindingServiceClient struct {
	Sif v1.ServiceInterface
}

func (WatcherBindingServiceClient) List

func (WatcherBindingServiceClient) Watch

type WatcherBindingServiceList

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

func (*WatcherBindingServiceList) GetItems

type WatcherConfig

type WatcherConfig[R any, RO runtime.Object, I K8SItem[RO], C K8SClient[RO, I]] struct {
	ListOptions metav1.ListOptions
	Log         *zerolog.Logger
	Context     context.Context
	K8sClient   C
}

Jump to

Keyboard shortcuts

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