resourcemanage

package
v0.0.0-...-1d80bfb Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructLogDetails

func ConstructLogDetails(podID string, rawLogs string, container string, logSelector *log.Selection) *log.LogDetails

ConstructLogDetails creates a new log details structure for given parameters.

func Filter

func Filter(c *gin.Context, object runtime.Object) (*int, error)

product match/sort/page to other function

func GetConfigMap

func GetConfigMap(c *gin.Context)

GetConfigMap show system configMap all users have read-only access ability

func GetFeatureConfig

func GetFeatureConfig(c *gin.Context)

GetFeatureConfig shows layout of integrated components all users have read-only access ability

func GetLogDetails

func GetLogDetails(client kubernetes.Interface, namespace, podID string, container string,
	logSelector *log.Selection, usePreviousLogs bool) (*log.LogDetails, error)

GetLogDetails returns logs for particular pod and container. When container is null, logs for the first one are returned. Previous indicates to read archived logs created by log rotation or container crash

func GetPodContainerLog

func GetPodContainerLog(c *gin.Context)

GetPodContainerLog get k8s pod log and page log Deprecated: Use GetProxyPodContainerLog instead, get better performance

func GetProxyPodContainerLog

func GetProxyPodContainerLog(c *gin.Context)

GetProxyPodContainerLog get native k8s pod container log

func IngressDomainSuffix

func IngressDomainSuffix(c *gin.Context)

IngressDomainSuffix Get Ingress Domain Suffix by cluster and project

func SetExtendHandler

func SetExtendHandler(resource enum.ResourceTypeEnum, extendFunc ExtendFunc)

SetExtendHandler the func to register real handler func

Types

type ExtendContext

type ExtendContext struct {
	Cluster      string
	Namespace    string
	Username     string
	Action       string
	ResourceName string

	// todo: remove this customize field to suitable place
	NginxNamespace           string
	NginxTcpServiceConfigMap string
	NginxUdpServiceConfigMap string
	Body                     []byte
	NodeStatus               string

	GinContext      *gin.Context
	FilterCondition *filter.Condition
	AuditHandler    *audit.Handler
}

type ExtendFunc

type ExtendFunc func(extendCtx ExtendContext) (interface{}, *errcode.ErrorInfo)

type ExtendHandler

type ExtendHandler struct {
	NginxNamespace           string
	NginxTcpServiceConfigMap string
	NginxUdpServiceConfigMap string
	// contains filtered or unexported fields
}

func NewExtendHandler

func NewExtendHandler(namespace string, tcpCm string, udpCm string) *ExtendHandler

func (*ExtendHandler) ExtendHandle

func (e *ExtendHandler) ExtendHandle(c *gin.Context)

ExtendHandle api/v1/kube/extend/clusters/{cluster}/namespaces/{namespace}/{resourceType}

type PodLog

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

func NewPodLog

func NewPodLog(client client.Client, namespace string, condition *filter.Condition) PodLog

func (*PodLog) HandleLogs

func (podLog *PodLog) HandleLogs(c *gin.Context)

type ProxyHandler

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

func NewProxyHandler

func NewProxyHandler(enableConvert bool) *ProxyHandler

func (*ProxyHandler) ProxyHandle

func (h *ProxyHandler) ProxyHandle(c *gin.Context)

ProxyHandle proxy all requests access to k8s, request uri format like below api/v1/kube/proxy/clusters/{cluster}/{k8s_url}

type ProxyPodLog

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

func NewProxyPodLog

func NewProxyPodLog(client client.Client, namespace string, condition *filter.Condition) ProxyPodLog

func (*ProxyPodLog) HandleLogs

func (podLog *ProxyPodLog) HandleLogs(c *gin.Context)

HandleLogs @router /api/v1/namespaces/{namespace}/proxy/pods/{resourceName}/log [get] resourceName: pod name, required namespace: pod namespace, required container: container name, required tailLines: tail lines, required timestamps: show timestamps or not, optional limitBytes: limit bytes, required sinceSeconds: since seconds, optional follow: follow or not, optional

type ResponseFilter

type ResponseFilter struct {
	Condition        *filter.Condition
	ConverterContext *filter.ConverterContext
}

Jump to

Keyboard shortcuts

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