conversion

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: LGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceNotFound = errors.New("service not found")

ErrServiceNotFound error not found

Functions

func ApplyPluginConfig

func ApplyPluginConfig(as *typesv1.AppService, servicePluginRelation *model.TenantEnvServicePluginRelation,
	dbmanager db.Manager, inboundPluginConfig *api_model.ResourceSpec)

ApplyPluginConfig applyPluginConfig

func InitAppService

func InitAppService(dbmanager db.Manager, serviceID string, configs map[string]string, enableConversionList ...string) (*v1.AppService, error)

InitAppService init a app service

func InitCacheAppService

func InitCacheAppService(dbm db.Manager, serviceID, creatorID string) (*v1.AppService, error)

InitCacheAppService init cache app service. if store manager receive a kube model belong with service and not find in store,will create

func RegistConversion

func RegistConversion(name string, fun Conversion)

RegistConversion regist conversion function list

func ServiceSource

func ServiceSource(as *v1.AppService, dbmanager db.Manager) error

ServiceSource conv ServiceSource

func TenantEnvServiceAutoscaler added in v1.1.0

func TenantEnvServiceAutoscaler(as *v1.AppService, dbmanager db.Manager) error

TenantEnvServiceAutoscaler -

func TenantEnvServiceBase added in v1.1.0

func TenantEnvServiceBase(as *v1.AppService, dbmanager db.Manager) error

TenantEnvServiceBase conv tenant env service base info

func TenantEnvServiceConfigGroup added in v1.1.0

func TenantEnvServiceConfigGroup(as *v1.AppService, dbm db.Manager) error

TenantEnvServiceConfigGroup -

func TenantEnvServiceMonitor added in v1.1.0

func TenantEnvServiceMonitor(as *v1.AppService, dbmanager db.Manager) error

TenantEnvServiceMonitor tenant env service monitor

func TenantEnvServicePlugin added in v1.1.0

func TenantEnvServicePlugin(as *typesv1.AppService, dbmanager db.Manager) error

TenantEnvServicePlugin conv service all plugin

func TenantEnvServiceRegist added in v1.1.0

func TenantEnvServiceRegist(as *v1.AppService, dbmanager db.Manager) error

TenantEnvServiceRegist conv inner and outer service regist

func TenantEnvServiceVersion added in v1.1.0

func TenantEnvServiceVersion(as *v1.AppService, dbmanager db.Manager) error

TenantEnvServiceVersion service deploy version conv. define pod spec

Types

type AppServiceBuild

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

AppServiceBuild has the ability to build k8s service, ingress and secret

func AppServiceBuilder

func AppServiceBuilder(serviceID, replicationType string, dbmanager db.Manager, as *v1.AppService) (*AppServiceBuild, error)

AppServiceBuilder returns a AppServiceBuild

func (AppServiceBuild) ApplyRules

func (a AppServiceBuild) ApplyRules(serviceID string, containerPort, pluginContainerPort int,
	service *corev1.Service) ([]interface{}, []*corev1.Secret, error)

ApplyRules applies http rules and tcp rules

func (*AppServiceBuild) Build

func (a *AppServiceBuild) Build() (*v1.K8sResources, error)

Build builds service, ingress and secret for each port

func (*AppServiceBuild) BuildOnPort

func (a *AppServiceBuild) BuildOnPort(p int, isOut bool) (*corev1.Service, error)

BuildOnPort 指定端口创建Service

func (*AppServiceBuild) CreateUpstreamPluginMappingPort

func (a *AppServiceBuild) CreateUpstreamPluginMappingPort(
	ports []*model.TenantEnvServicesPort,
	pluginPorts []*model.TenantEnvServicesStreamPluginPort,
) (
	[]*model.TenantEnvServicesPort,
	map[int32]int,
	error)

CreateUpstreamPluginMappingPort 检查是否存在upstream插件,接管入口网络

func (*AppServiceBuild) CreateUpstreamPluginMappingService

func (a *AppServiceBuild) CreateUpstreamPluginMappingService(services []*corev1.Service,
	pp map[int32]int) ([]*corev1.Service, error)

CreateUpstreamPluginMappingService 增加service plugin mapport 标签

type CacheConversion

type CacheConversion struct {
	Name       string
	Conversion Conversion
}

CacheConversion conversion cache struct

type Conversion

type Conversion func(*v1.AppService, db.Manager) error

Conversion conversion function Any application attribute implementation is similarly injected

Jump to

Keyboard shortcuts

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