Documentation ¶
Overview ¶
Package endpoints 定义所有的 route handle.
Index ¶
- type Endpoints
- func (e *Endpoints) CreateRule(ctx context.Context, r *http.Request, _ map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) DeleteRule(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) DownloadRelease(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) error
- func (e *Endpoints) GetDiceYAML(w http.ResponseWriter, r *http.Request)
- func (e *Endpoints) Info(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) ListRules(ctx context.Context, r *http.Request, _ map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) Release() *release.Release
- func (e *Endpoints) ReleaseRuleMiddleware(handler httpserver.Handler) httpserver.Handler
- func (e *Endpoints) Routes() []httpserver.Endpoint
- func (e *Endpoints) UpdateRule(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- type Option
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 (*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) ReleaseRuleMiddleware ¶
func (e *Endpoints) ReleaseRuleMiddleware(handler httpserver.Handler) httpserver.Handler
func (*Endpoints) Routes ¶
func (e *Endpoints) Routes() []httpserver.Endpoint
Routes 返回 endpoints 的所有 endpoint 方法,也就是 route.
type Option ¶
type Option func(*Endpoints)
func WithQueryStringDecoder ¶
WithQueryStringDecoder 配置 queryStringDecoder
func WithReleaseRule ¶
func WithReleaseRule(rule *release_rule.ReleaseRule) Option
Click to show internal directories.
Click to hide internal directories.