apidocsvc

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TreeNameAPIDocs = "api-docs"
	TreeNameSchemas = "schemas"
)

Variables

This section is empty.

Functions

func CommitAPIDocCreation

func CommitAPIDocCreation(orgID uint64, userID, repo, commitMessage, serviceName, content, branch string) error

func CommitAPIDocModifies

func CommitAPIDocModifies(orgID uint64, userID, repo, commitMessage, serviceName, content, branch string) error

func FetchAPIDocContent

func FetchAPIDocContent(orgID uint64, userID, inode string, specProtocol oasconv.Protocol, branchRuleSvc *branchrule.BranchRule) (*apistructs.FileTreeNodeRspData,
	*errorresp.APIError)

Types

type APIDocWSHandler

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

func (*APIDocWSHandler) AfterConnected

func (h *APIDocWSHandler) AfterConnected(w websocket.ResponseWriter)

建立连接时的处理方法 建立连接时立即下发 sessionID 和 lock 状态

func (*APIDocWSHandler) BeforeClose

func (h *APIDocWSHandler) BeforeClose(w websocket.ResponseWriter, err error)

连接关闭前的处理方法 暂存的文档提交到 gittar, 释放 session 持有的文档锁, 将错误信息透给客户端

type Option

type Option func(service *Service)

func WithBranchRuleSvc

func WithBranchRuleSvc(svc *branchrule.BranchRule) Option

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

type Service

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

func New

func New(options ...Option) *Service

func (*Service) DeleteNode

func (svc *Service) DeleteNode(req *apistructs.APIDocDeleteNodeReq) *errorresp.APIError

func (*Service) ListChildren

ListChildren lists all children nodes if the parent node is 0, it lists all branches, else if the TreeName is "api-docs", lists all api docs, if the TreeName is "schemas", lists schemas.

func (*Service) Upgrade

Upgrade updates the scheme http to ws. It writes the error to w http.ResponseWriter, so the caller need not to handle the error.

Jump to

Keyboard shortcuts

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