k8s

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionHook

type ActionHook func(ctx *gin.Context, db *kubernetes.Clientset, m any) error

type Control

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

func NewControl

func NewControl(opts ...Option) *Control

func (*Control) Handler

func (e *Control) Handler() gin.HandlersChain

func (*Control) String

func (*Control) String() string

type Delete

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

func NewDelete

func NewDelete(opts ...Option) *Delete

NewDelete new delete action

func (*Delete) Handler

func (e *Delete) Handler() gin.HandlersChain

func (*Delete) String

func (*Delete) String() string

type Get

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

func NewGet

func NewGet(opts ...Option) *Get

func (*Get) Handler

func (e *Get) Handler() gin.HandlersChain

func (*Get) String

func (*Get) String() string

type Option

type Option func(*Options)

func WithAfterCreate

func WithAfterCreate(hook ActionHook) Option

WithAfterCreate set after create hook

func WithAfterDelete

func WithAfterDelete(hook ActionHook) Option

WithAfterDelete set after delete hook

func WithAfterGet

func WithAfterGet(hook ActionHook) Option

WithAfterGet set after get hook

func WithAfterSearch

func WithAfterSearch(hook ActionHook) Option

WithAfterSearch set after search hook

func WithAfterUpdate

func WithAfterUpdate(hook ActionHook) Option

WithAfterUpdate set after update hook

func WithBeforeCreate

func WithBeforeCreate(hook ActionHook) Option

WithBeforeCreate set before create hook

func WithBeforeDelete

func WithBeforeDelete(hook ActionHook) Option

WithBeforeDelete set before delete hook

func WithBeforeGet

func WithBeforeGet(hook ActionHook) Option

WithBeforeGet set before get hook

func WithBeforeSearch

func WithBeforeSearch(hook ActionHook) Option

WithBeforeSearch set before search hook

func WithBeforeUpdate

func WithBeforeUpdate(hook ActionHook) Option

WithBeforeUpdate set before update hook

func WithControlHandlers

func WithControlHandlers(handlers gin.HandlersChain) Option

WithControlHandlers set control handlers

func WithDeleteHandlers

func WithDeleteHandlers(handlers gin.HandlersChain) Option

WithDeleteHandlers set delete handlers

func WithGetHandlers

func WithGetHandlers(handlers gin.HandlersChain) Option

WithGetHandlers set get handlers

func WithHandlers

func WithHandlers(handlers gin.HandlersChain) Option

WithHandlers set handlers

func WithKey

func WithKey(key string) Option

WithKey set key

func WithModel

func WithModel(m any) Option

WithModel set model

func WithResourceType

func WithResourceType(rt ResourceType) Option

WithResourceType set resource type

func WithSearchHandlers

func WithSearchHandlers(handlers gin.HandlersChain) Option

WithSearchHandlers set search handlers

type Options

type Options struct {
	ResourceType ResourceType
	Model        any
	Handlers     gin.HandlersChain
	Key          string
	BeforeCreate ActionHook
	AfterCreate  ActionHook
	BeforeUpdate ActionHook
	AfterUpdate  ActionHook
	BeforeGet    ActionHook
	AfterGet     ActionHook
	BeforeDelete ActionHook
	AfterDelete  ActionHook
	BeforeSearch ActionHook
	AfterSearch  ActionHook
	// contains filtered or unexported fields
}

type ResourceType

type ResourceType string
const (
	Deployment            ResourceType = "deployment"
	Service               ResourceType = "service"
	Pod                   ResourceType = "pod"
	ConfigMap             ResourceType = "configmap"
	Secret                ResourceType = "secret"
	StatefulSet           ResourceType = "statefulset"
	Job                   ResourceType = "job"
	CronJob               ResourceType = "cronjob"
	DaemonSet             ResourceType = "daemonset"
	Ingress               ResourceType = "ingress"
	ResourceQuota         ResourceType = "resourcequota"
	LimitRange            ResourceType = "limitrange"
	PersistentVolume      ResourceType = "persistentvolume"
	PersistentVolumeClaim ResourceType = "persistentvolumeclaim"
	Namespace             ResourceType = "namespace"
	StorageClass          ResourceType = "storageclass"
	IngressClass          ResourceType = "ingressclass"
)
type Search struct {
	// contains filtered or unexported fields
}

Search action fixme: not support pagination

func NewSearch

func NewSearch(opts ...Option) *Search

func (*Search) Handler

func (e *Search) Handler() gin.HandlersChain

func (*Search) String

func (*Search) String() string

Jump to

Keyboard shortcuts

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