controllers

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// at.RestController or at.RestController must be embedded here
	at.RestController
	at.UseMiddleware
	at.RequestMapping `value:"/api/v1/namespaces/{namespace}"`
}

Controller Rest Controller with path / RESTful Controller, derived from at.RestController. The context mapping of this controller is '/' by default

func (*Controller) ListDeployment

func (c *Controller) ListDeployment(_ struct {
	at.GetMapping `value:"/deployments"`
	at.Operation  `id:"List Deployments" description:"List Deployments of giving namespace"`
	at.Consumes   `values:"application/json"`
	at.Produces   `values:"application/json"`
	Parameters    struct {
		at.Parameter `type:"string" name:"namespace" in:"path" description:"Path Variable(Namespace)" required:"true"`
	}
	Responses struct {
		StatusOK struct {
			at.Parameter `name:"Namespace" in:"body" description:"Get Deployment List"`
			PodListResponse
		}
	}
}, namespace string, token *oidc.Token, kubeClient *kubeclient.Client) (response *DeploymentListResponse, err error)

ListDeployment list all deployments

func (*Controller) ListPods

func (c *Controller) ListPods(_ struct {
	at.GetMapping `value:"/pods"`
	at.Operation  `id:"List Pods" description:"List Pods of giving namespace"`
	at.Consumes   `values:"application/json"`
	at.Produces   `values:"application/json"`
	Parameters    struct {
		at.Parameter `type:"string" name:"namespace" in:"path" description:"Path Variable(Namespace)" required:"true"`
	}
	Responses struct {
		StatusOK struct {
			at.Parameter `name:"Namespace" in:"body" description:"Get Pod List"`
			PodListResponse
		}
	}
}, namespace string, kubeClient *kubeclient.Client) (response *PodListResponse, err error)

ListPods list all pods for specific namespace

func (*Controller) ListPodsByUser

func (c *Controller) ListPodsByUser(_ struct {
	at.GetMapping `value:"/pods/user"`
	at.Operation  `id:"List Pods" description:"List Pods of giving namespace"`
	at.Consumes   `values:"application/json"`
	at.Produces   `values:"application/json"`
	Parameters    struct {
		at.Parameter `type:"string" name:"namespace" in:"path" description:"Path Variable(Namespace)" required:"true"`
	}
	Responses struct {
		StatusOK struct {
			at.Parameter `name:"Namespace" in:"body" description:"Get Pod List"`
			PodListResponse
		}
	}
}, namespace string, runtimeClient *kubeclient.RuntimeClient) (response *PodListResponse, err error)

ListPodsByUser list all pods by user

func (*Controller) ListServices

func (c *Controller) ListServices(_ struct {
	at.GetMapping `value:"/services"`
	at.Operation  `id:"List Services" description:"List Services of giving namespace"`
	at.Consumes   `values:"application/json"`
	at.Produces   `values:"application/json"`
	Parameters    struct {
		at.Parameter `type:"string" name:"namespace" in:"path" description:"Path Variable(Namespace)" required:"true"`
	}
	Responses struct {
		StatusOK struct {
			at.Parameter `name:"Namespace" in:"body" description:"Get Service List"`
			ServiceListResponse
		}
	}
}, namespace string, runtimeClient *kubeclient.RuntimeClient) (response *ServiceListResponse, err error)

ListServices list all services

type DeploymentListResponse

type DeploymentListResponse struct {
	model.BaseResponseInfo
	Data *appsv1.DeploymentList `json:"data"`
}

type MyAppReconciler

type MyAppReconciler struct {
	kube.Controller
	at.Scope `value:"prototype"`

	client.Client
	Scheme *runtime.Scheme
}

MyAppReconciler reconciles a MyApp object

func (*MyAppReconciler) Reconcile

func (r *MyAppReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*MyAppReconciler) SetupWithManager

func (r *MyAppReconciler) SetupWithManager(mgr ctrl.Manager) error

type PodListResponse

type PodListResponse struct {
	model.BaseResponseInfo
	Data *corev1.PodList `json:"data"`
}

type ServiceListResponse

type ServiceListResponse struct {
	model.BaseResponseInfo
	Data *corev1.ServiceList `json:"data"`
}

Jump to

Keyboard shortcuts

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