discovery

package
v0.0.0-...-7c3836c Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceNamePattern = errors.New("名称格式不符合要求,请重新填写")
	ErrServiceK8sDelete   = errors.New("删除Service资源错误,请查询是否存在")
	ErrServiceK8sList     = errors.New("获取Service资源列表错误,请查询是否存在")
	ErrServiceK8sGet      = errors.New("获取Service资源错误,请查询是否存在")
	ErrServiceTplGet      = errors.New("获取Service模版错误,请联系管理员")
	ErrServiceTplParse    = errors.New("解析Service模版错误,请联系管理员")
	ErrServiceK8sCreate   = errors.New("创建Service错误,可能已经存在")
	ErrServiceK8sUpdate   = errors.New("更新Service错误,可能已经存在")
	ErrEndpointsTplGet    = errors.New("获取Endpoints模版错误,请联系管理员")
	ErrEndpointsParse     = errors.New("创建Endpoints错误,请联系管理员")
	ErrEndpointsK8sGet    = errors.New("获取Endpoints错误,可能不存在")
	ErrEndpointsK8sCreate = errors.New("创建Endpoints错误,请联系管理员")
	ErrProjectGet         = errors.New("项目可能不存在,无法与之关联")
)

Functions

func MakeHandler

func MakeHandler(svc Service, logger log.Logger) http.Handler

Types

type ResourceType

type ResourceType string
const (
	ServiceResourceType  ResourceType = "service"
	EndpointResourceType ResourceType = "endpoint"
)

type Service

type Service interface {
	// 删除service
	Delete(ctx context.Context, svcName string) error

	// 查看service详情
	Detail(ctx context.Context, svcName string) (map[string]interface{}, error)

	// Service 列表页
	List(ctx context.Context, page, limit int) (res []*serviceList, err error)

	// 创建Service
	Create(ctx context.Context, req createRequest) (err error)

	// 更新service
	Update(ctx context.Context, req createRequest) (err error)

	// 创建service
	// Deprecated: 这个功能可以去掉
	PostYaml(ctx context.Context, body []byte) error
}

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

func NewService

func NewService(logger log.Logger, k8sClient kubernetes.K8sClient,
	config *config.Config, store repository.Repository) Service

Jump to

Keyboard shortcuts

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