Documentation ¶
Index ¶
- Constants
- func CommitAPIDocCreation(orgID uint64, userID, repo, commitMessage, serviceName, content, branch string) error
- func CommitAPIDocModifies(orgID uint64, userID, repo, commitMessage, serviceName, content, branch string) error
- func FetchAPIDocContent(orgID uint64, userID, inode string, specProtocol oasconv.Protocol, ...) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- type APIDocWSHandler
- type Option
- type Service
- func (svc *Service) CopyNode(req *apistructs.APIDocMvCpNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- func (svc *Service) CreateNode(req *apistructs.APIDocCreateNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- func (svc *Service) DeleteNode(req *apistructs.APIDocDeleteNodeReq) *errorresp.APIError
- func (svc *Service) GetNodeDetail(req *apistructs.APIDocNodeDetailReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- func (svc *Service) ListChildren(req *apistructs.APIDocListChildrenReq) ([]*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- func (svc *Service) MoveNode(req *apistructs.APIDocMvCpNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- func (svc *Service) UpdateNode(req *apistructs.APIDocUpdateNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
- func (svc *Service) Upgrade(w http.ResponseWriter, r *http.Request, req *apistructs.WsAPIDocHandShakeReq) *errorresp.APIError
Constants ¶
View Source
const ( TreeNameAPIDocs = "api-docs" TreeNameSchemas = "schemas" )
Variables ¶
This section is empty.
Functions ¶
func CommitAPIDocCreation ¶
func CommitAPIDocModifies ¶
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 WithDBClient ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CopyNode ¶
func (svc *Service) CopyNode(req *apistructs.APIDocMvCpNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
func (*Service) CreateNode ¶
func (svc *Service) CreateNode(req *apistructs.APIDocCreateNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
func (*Service) DeleteNode ¶
func (svc *Service) DeleteNode(req *apistructs.APIDocDeleteNodeReq) *errorresp.APIError
func (*Service) GetNodeDetail ¶
func (svc *Service) GetNodeDetail(req *apistructs.APIDocNodeDetailReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
func (*Service) ListChildren ¶
func (svc *Service) ListChildren(req *apistructs.APIDocListChildrenReq) ([]*apistructs.FileTreeNodeRspData, *errorresp.APIError)
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) MoveNode ¶
func (svc *Service) MoveNode(req *apistructs.APIDocMvCpNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
func (*Service) UpdateNode ¶
func (svc *Service) UpdateNode(req *apistructs.APIDocUpdateNodeReq) (*apistructs.FileTreeNodeRspData, *errorresp.APIError)
func (*Service) Upgrade ¶
func (svc *Service) Upgrade(w http.ResponseWriter, r *http.Request, req *apistructs.WsAPIDocHandShakeReq) *errorresp.APIError
Upgrade updates the scheme http to ws. It writes the error to w http.ResponseWriter, so the caller need not to handle the error.
Click to show internal directories.
Click to hide internal directories.