service

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func MustGetUserid

func MustGetUserid(ctx context.Context) string

func TokenSecretName

func TokenSecretName(ctx context.Context, gitProvider string) string

Types

type AppEventService

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

func NewAppEventService

func NewAppEventService(loki *loki.Client) *AppEventService

func (*AppEventService) List

func (s *AppEventService) List(ctx context.Context, query string) ([]*model.Event, error)

type AppPodsService

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

func NewAppPodsService

func NewAppPodsService(mci *watch.MultiClusterInformers) *AppPodsService

func (*AppPodsService) OnAdd

func (s *AppPodsService) OnAdd(obj interface{})

func (*AppPodsService) OnDelete

func (s *AppPodsService) OnDelete(obj interface{})

func (*AppPodsService) OnUpdate

func (s *AppPodsService) OnUpdate(oldObj, newObj interface{})

func (*AppPodsService) Pods

func (s *AppPodsService) Pods(ctx context.Context, ns, appName string) ([]*model.Pod, error)

func (*AppPodsService) SubPods

func (s *AppPodsService) SubPods(ctx context.Context, ns string, app string) chan []*model.Pod

type AppService

type AppService struct {
	app.UnimplementedAppServiceServer
	// contains filtered or unexported fields
}

func NewAppService

func NewAppService(daoProj *dao.ProjectDao, daoApp *dao.AppDao, daoEntry *dao.EntryDao, daoRoute *dao.RouteDao, daoMwInstance *dao.MiddlewareInstance, daoMwClaim *dao.MiddlewareClaim, daoEgress *dao.EgressDao, k8sClient *kubernetes.Clientset, oamClient *versioned.Clientset) *AppService

func (*AppService) CfgCreate

func (s *AppService) CfgCreate(ctx context.Context, in *app.AppCfg) (*app.Configuration, error)

func (*AppService) CfgDelete

func (s *AppService) CfgDelete(ctx context.Context, in *app.AppCfg) (*emptypb.Empty, error)

func (*AppService) CfgUpdate

func (s *AppService) CfgUpdate(ctx context.Context, in *app.AppCfg) (*app.Configuration, error)

func (*AppService) Create

func (s *AppService) Create(ctx context.Context, in *app.Application) (*app.Application, error)

func (*AppService) Delete

func (s *AppService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*AppService) DoAction

func (s *AppService) DoAction(ctx context.Context, in *app.ActionPayload) (*app.Application, error)

func (*AppService) EnvCreate

func (s *AppService) EnvCreate(ctx context.Context, in *app.AppEnv) (*app.Environment, error)

func (*AppService) EnvDelete

func (s *AppService) EnvDelete(ctx context.Context, in *app.AppEnv) (*emptypb.Empty, error)

func (*AppService) EnvUpdate

func (s *AppService) EnvUpdate(ctx context.Context, in *app.AppEnv) (*app.Environment, error)

func (*AppService) List

func (s *AppService) List(ctx context.Context, req *app.ListRequest) (*app.ListResponse, error)

func (*AppService) Read

func (p *AppService) Read(ctx context.Context, in *kiae.IdRequest) (*app.Application, error)

func (*AppService) Update

func (s *AppService) Update(ctx context.Context, in *app.UpdateRequest) (*app.Application, error)

type AppStatusService

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

func NewAppStatusService

func NewAppStatusService(rClient client.Client, velaClients *vela.Clientset, appSvc *AppService) *AppStatusService

func (*AppStatusService) OnAdd

func (s *AppStatusService) OnAdd(obj interface{})

func (*AppStatusService) OnDelete

func (s *AppStatusService) OnDelete(obj interface{})

func (*AppStatusService) OnUpdate

func (s *AppStatusService) OnUpdate(oldObj, newObj interface{})

type BuilderSvc

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

func NewBuilderSvc

func NewBuilderSvc(daoProjImg *dao.BuilderDao, imageRegistrySvc *ImageRegistrySvc, kClients *klient.LocalClients) *BuilderSvc

func (*BuilderSvc) Create

func (s *BuilderSvc) Create(ctx context.Context, in *builder.Builder) (*builder.Builder, error)

func (*BuilderSvc) Delete

func (s *BuilderSvc) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*BuilderSvc) List

func (*BuilderSvc) SuggestedStacks

func (s *BuilderSvc) SuggestedStacks(ctx context.Context, empty *emptypb.Empty) (*builder.SuggestedStackListResponse, error)

func (*BuilderSvc) Update

func (s *BuilderSvc) Update(ctx context.Context, in *builder.Builder) (*builder.Builder, error)

type ClusterService

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

func NewClusterService

func NewClusterService(daoCluster *dao.ClusterDao, wci *watch.MultiClusterInformers) *ClusterService

func (*ClusterService) Create

func (*ClusterService) Delete

func (s *ClusterService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*ClusterService) List

func (*ClusterService) Update

type CtxKey

type CtxKey string
const (
	CtxUserid    CtxKey = "kiae-userid"
	CtxUserRoles CtxKey = "kiae-user-roles"
)

type DeploymentService

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

func NewDeploymentService

func NewDeploymentService(deploymentDao *dao.DeploymentDao, imageSvc *ProjectImageSvc, appSvc *AppService) *DeploymentService

func (*DeploymentService) Create

func (*DeploymentService) Delete

func (*DeploymentService) Update

type EValue

type EValue struct {
	Body       string `json:"body"`
	Severity   string `json:"severity"`
	Attributes struct {
		K8SEventAction    string `json:"k8s.event.action"`
		K8SEventCount     int    `json:"k8s.event.count"`
		K8SEventName      string `json:"k8s.event.name"`
		K8SEventReason    string `json:"k8s.event.reason"`
		K8SEventStartTime string `json:"k8s.event.start_time"`
		K8SEventUid       string `json:"k8s.event.uid"`
		K8SNamespaceName  string `json:"k8s.namespace.name"`
	} `json:"attributes"`
	Resources struct {
		K8SNodeName              string `json:"k8s.node.name"`
		K8SObjectApiVersion      string `json:"k8s.object.api_version"`
		K8SObjectFieldpath       string `json:"k8s.object.fieldpath"`
		K8SObjectKind            string `json:"k8s.object.kind"`
		K8SObjectName            string `json:"k8s.object.name"`
		K8SObjectResourceVersion string `json:"k8s.object.resource_version"`
		K8SObjectUid             string `json:"k8s.object.uid"`
	} `json:"resources"`
}

type EgressService

type EgressService struct {
	egress.UnimplementedEgressServiceServer
	// contains filtered or unexported fields
}

func NewEgressService

func NewEgressService(appSvc *AppService, daoEgress *dao.EgressDao) *EgressService

func (*EgressService) Create

func (s *EgressService) Create(ctx context.Context, in *egress.Egress) (*egress.Egress, error)

func (*EgressService) Delete

func (s *EgressService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*EgressService) List

func (*EgressService) Update

func (s *EgressService) Update(ctx context.Context, in *egress.Egress) (*egress.Egress, error)

type EntryService

type EntryService struct {
	entry.UnimplementedEntryServiceServer
	// contains filtered or unexported fields
}

func NewEntryService

func NewEntryService(appSvc *AppService, daoEntry *dao.EntryDao) *EntryService

func (*EntryService) Create

func (s *EntryService) Create(ctx context.Context, in *entry.Entry) (*entry.Entry, error)

func (*EntryService) Delete

func (s *EntryService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*EntryService) List

func (*EntryService) Update

func (s *EntryService) Update(ctx context.Context, in *entry.UpdateRequest) (*entry.Entry, error)

type Events

type Events []eEvent

func (Events) Events

func (es Events) Events() []*model.Event

func (Events) Len

func (es Events) Len() int

func (Events) Less

func (es Events) Less(i, j int) bool

func (Events) Swap

func (es Events) Swap(i, j int)

type Gateway added in v0.0.3

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

func NewGateway added in v0.0.3

func NewGateway(daoGateway *dao.Gateway, kClients *klient.LocalClients) *Gateway

func (*Gateway) Create added in v0.0.3

func (s *Gateway) Create(ctx context.Context, in *gateway.Gateway) (*gateway.Gateway, error)

func (*Gateway) Delete added in v0.0.3

func (s *Gateway) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*Gateway) List added in v0.0.3

func (*Gateway) Update added in v0.0.3

func (s *Gateway) Update(ctx context.Context, in *gateway.UpdateRequest) (*gateway.Gateway, error)

type ImageRegistrySvc

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

func NewImageRegistrySvc

func NewImageRegistrySvc(imageRegistryDao *dao.ImageRegistryDao, kClients *klient.LocalClients) *ImageRegistrySvc

func (*ImageRegistrySvc) Create

func (*ImageRegistrySvc) Delete

func (s *ImageRegistrySvc) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*ImageRegistrySvc) List

func (*ImageRegistrySvc) Update

type ImageWatcher

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

func NewImageWatcher

func NewImageWatcher(imgSvc *ProjectImageSvc, kClients *klient.LocalClients) *ImageWatcher

func (*ImageWatcher) OnAdd

func (i *ImageWatcher) OnAdd(obj interface{})

func (*ImageWatcher) OnDelete

func (i *ImageWatcher) OnDelete(obj interface{})

func (*ImageWatcher) OnUpdate

func (i *ImageWatcher) OnUpdate(oldObj, newObj interface{})

type MiddlewareService

type MiddlewareService struct {
	middleware.UnimplementedMiddlewareServiceServer
	// contains filtered or unexported fields
}

func NewMiddlewareService

func NewMiddlewareService(rc client.Client, kc *kubernetes.Clientset, daoMwInstance *dao.MiddlewareInstance, daoMwClaim *dao.MiddlewareClaim, appSvc *AppService) *MiddlewareService

func (*MiddlewareService) ClaimCreate

func (s *MiddlewareService) ClaimCreate(ctx context.Context, in *middleware.Claim) (*middleware.Claim, error)

func (*MiddlewareService) ClaimDelete

func (s *MiddlewareService) ClaimDelete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*MiddlewareService) ClaimUpdate

func (s *MiddlewareService) ClaimUpdate(ctx context.Context, in *middleware.Claim) (*middleware.Claim, error)

func (*MiddlewareService) Claims

func (*MiddlewareService) Create

func (*MiddlewareService) Delete

func (*MiddlewareService) List

func (*MiddlewareService) Update

type Oauth2

type Oauth2 struct {
	oauth2.Oauth2
	// contains filtered or unexported fields
}

func NewProviderOauth2Svc

func NewProviderOauth2Svc(pvdSvc *ProviderService) *Oauth2

func (*Oauth2) SetupEndpoints

func (s *Oauth2) SetupEndpoints(router *mux.Router)

type ProjectImageSvc

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

func NewProjectImageSvc

func NewProjectImageSvc(daoProj *dao.ProjectDao, daoProjImg *dao.ProjectImageDao, daoBuilder *dao.BuilderDao,
	svcRegistry *ImageRegistrySvc, svcProvider *ProviderService, kClients *klient.LocalClients) *ProjectImageSvc

func (*ProjectImageSvc) Create

func (s *ProjectImageSvc) Create(ctx context.Context, in *image.Image) (*image.Image, error)

func (*ProjectImageSvc) Delete

func (s *ProjectImageSvc) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*ProjectImageSvc) List

func (*ProjectImageSvc) ListNotDoneStatus

func (s *ProjectImageSvc) ListNotDoneStatus(ctx context.Context) ([]*image.Image, error)

func (*ProjectImageSvc) Update

func (s *ProjectImageSvc) Update(ctx context.Context, in *image.Image) (*image.Image, error)

func (*ProjectImageSvc) UpdateStatus

func (s *ProjectImageSvc) UpdateStatus(ctx context.Context, name string, status image.Image_Status) (*image.Image, error)

type ProjectService

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

func NewProjectService

func NewProjectService(daoProj *dao.ProjectDao, builderSvc *BuilderSvc) *ProjectService

func (*ProjectService) Create

func (*ProjectService) Delete

func (p *ProjectService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*ProjectService) List

func (*ProjectService) Read

func (*ProjectService) Update

type ProviderService

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

func NewProviderService

func NewProviderService(daoProvider *dao.ProviderDao, kClients *klient.LocalClients) *ProviderService

func (*ProviderService) Config

func (s *ProviderService) Config(ctx context.Context, providerName string) (*oauth2.Config, error)

func (*ProviderService) Create

func (*ProviderService) Delete

func (s *ProviderService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*ProviderService) GetOauth2Config

func (s *ProviderService) GetOauth2Config(ctx context.Context, providerName string) (*oauth2.Config, error)

func (*ProviderService) List

func (*ProviderService) ListBranches

func (*ProviderService) ListRepos

func (*ProviderService) ListTags

func (*ProviderService) Prepare

func (*ProviderService) TokenF

func (s *ProviderService) TokenF(ctx context.Context, providerName string, token *oauth2.Token) error

func (*ProviderService) Update

type RouteService

type RouteService struct {
	route.UnimplementedRouteServiceServer
	// contains filtered or unexported fields
}

func NewRouteService

func NewRouteService(appSvc *AppService, daoRoute *dao.RouteDao) *RouteService

func (*RouteService) Create

func (s *RouteService) Create(ctx context.Context, in *route.Route) (*route.Route, error)

func (*RouteService) Delete

func (s *RouteService) Delete(ctx context.Context, in *kiae.IdRequest) (*emptypb.Empty, error)

func (*RouteService) List

func (*RouteService) Update

func (s *RouteService) Update(ctx context.Context, in *route.UpdateRequest) (*route.Route, error)

type Session

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

func NewSession

func NewSession(oidc *oauth2.OIDC, userSvc *UserSvc) *Session

func (*Session) Middleware

func (s *Session) Middleware() mux.MiddlewareFunc

func (*Session) SetupEndpoints

func (s *Session) SetupEndpoints(router *mux.Router)

type System added in v0.0.8

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

func NewSystem added in v0.0.8

func NewSystem(daoProvider *dao.ProviderDao, daoRegistry *dao.ImageRegistryDao, daoBuilder *dao.BuilderDao) *System

func (*System) GetStatus added in v0.0.8

func (s *System) GetStatus(ctx context.Context, empty *emptypb.Empty) (*system.SystemStatus, error)

type UserSvc

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

func NewUserSvc

func NewUserSvc(userDao *dao.UserDao) *UserSvc

func (*UserSvc) Info added in v0.0.3

func (s *UserSvc) Info(ctx context.Context, empty *emptypb.Empty) (*user.User, error)

func (*UserSvc) List

Jump to

Keyboard shortcuts

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