endpoints

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package endpoints 定义所有的 route handle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoints

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

Endpoints 定义 endpoint 方法

func New

func New(options ...Option) *Endpoints

New 创建 Endpoints 对象.

func (*Endpoints) CreateRule

func (e *Endpoints) CreateRule(ctx context.Context, r *http.Request, _ map[string]string) (httpserver.Responser, error)

CreateRule creates release rule record

func (*Endpoints) DeleteRule

func (e *Endpoints) DeleteRule(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

DeleteRule deletes the given release rule

func (*Endpoints) DownloadRelease

func (e *Endpoints) DownloadRelease(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error

DownloadRelease GET /api/releases/{releaseId}/actions/download 下载制品zip包

func (*Endpoints) GetDiceYAML

func (e *Endpoints) GetDiceYAML(w http.ResponseWriter, r *http.Request)

GetDiceYAML GET /api/releases/<releaseId>/actions/get-dice 获取dice.yml内容处理

func (*Endpoints) Info

func (e *Endpoints) Info(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

Info 用于健康检查

func (*Endpoints) ListRules

func (e *Endpoints) ListRules(ctx context.Context, r *http.Request, _ map[string]string) (httpserver.Responser, error)

ListRules lists release rules for the given project

func (*Endpoints) Release

func (e *Endpoints) Release() *release.Release

Release 获取 release service

func (*Endpoints) ReleaseRuleMiddleware

func (e *Endpoints) ReleaseRuleMiddleware(handler httpserver.Handler) httpserver.Handler

func (*Endpoints) Routes

func (e *Endpoints) Routes() []httpserver.Endpoint

Routes 返回 endpoints 的所有 endpoint 方法,也就是 route.

func (*Endpoints) UpdateRule

func (e *Endpoints) UpdateRule(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

UpdateRule updates the given release rule

type Option

type Option func(*Endpoints)

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

WithDBClient 配置 db

func WithOrg

func WithOrg(org org.Interface) Option

func WithQueryStringDecoder

func WithQueryStringDecoder(decoder *schema.Decoder) Option

WithQueryStringDecoder 配置 queryStringDecoder

func WithRelease

func WithRelease(release *release.Release) Option

WithRelease 配置 release service

func WithReleaseRule

func WithReleaseRule(rule *release_rule.ReleaseRule) Option

Jump to

Keyboard shortcuts

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