Documentation
¶
Index ¶
- Constants
- Variables
- func HostingMiddleware(githubService *github.GithubService) gin.HandlerFunc
- func OwnerMiddleware() gin.HandlerFunc
- func PathMiddleware() gin.HandlerFunc
- func RepoMiddleware() gin.HandlerFunc
- func RespondError(ctx *gin.Context, status int, msg string, errs ...error)
- func RespondJSON(c *gin.Context, status int, payload interface{})
- func Routes(r *gin.Engine, h *Handler, githubService *github.GithubService)
- type CommitForm
- type ContentTypeFilter
- type CreateBranchForm
- type DeleteBranchUri
- type ErrorModel
- type FileContentForm
- type FileURI
- type Handler
- func (h *Handler) CreateBranch(ctx *gin.Context)
- func (h *Handler) CreateFile(ctx *gin.Context)
- func (h *Handler) DeleteBranch(ctx *gin.Context)
- func (h *Handler) DeleteFile(ctx *gin.Context)
- func (h *Handler) GetBranches(ctx *gin.Context)
- func (h *Handler) GetCommits(ctx *gin.Context)
- func (h *Handler) GetFiles(ctx *gin.Context)
- func (h *Handler) GetRepositories(ctx *gin.Context)
- func (h *Handler) GetRepository(ctx *gin.Context)
- func (h *Handler) UpdateFile(ctx *gin.Context)
- type RefForm
- type StatusError
Constants ¶
View Source
const ( GithubHost = "github.com" GitlabHost = "gitlab.com" )
View Source
const ( HTTPRequestValidationFailed = "HTTP Request Validation failed." UnknownGitProviderError = "An error occured during Git Provider request." )
View Source
const (
RawMimeTypes string = "application/vnd.giteway.raw"
)
Variables ¶
View Source
var NewError = func(status int, msg string) StatusError { return &ErrorModel{ Status: status, Title: http.StatusText(status), Detail: msg, } }
Functions ¶
func HostingMiddleware ¶ added in v0.1.4
func HostingMiddleware(githubService *github.GithubService) gin.HandlerFunc
func OwnerMiddleware ¶ added in v0.1.4
func OwnerMiddleware() gin.HandlerFunc
func PathMiddleware ¶ added in v0.1.4
func PathMiddleware() gin.HandlerFunc
func RepoMiddleware ¶ added in v0.1.4
func RepoMiddleware() gin.HandlerFunc
func RespondError ¶ added in v0.1.4
func RespondJSON ¶ added in v0.1.4
Types ¶
type CommitForm ¶ added in v0.1.0
type CommitForm struct {
Message *string `form:"message,omitempty" json:"message,omitempty"`
}
type ContentTypeFilter ¶ added in v0.1.2
type CreateBranchForm ¶ added in v0.1.0
type CreateBranchForm struct {
Name string `uri:"name" binding:"required"`
}
type DeleteBranchUri ¶ added in v0.1.0
type DeleteBranchUri struct {
Branch string `uri:"branch" binding:"required"`
}
type ErrorModel ¶ added in v0.1.2
type ErrorModel struct { Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` Status int `json:"status,omitempty"` Detail string `json:"detail,omitempty"` }
https://datatracker.ietf.org/doc/html/rfc7807
func (*ErrorModel) Error ¶ added in v0.1.2
func (e *ErrorModel) Error() string
func (*ErrorModel) GetStatus ¶ added in v0.1.2
func (e *ErrorModel) GetStatus() int
type FileContentForm ¶ added in v0.1.0
type FileContentForm struct { Encoding string `form:"encoding,default=text" json:"encoding"` Content string `form:"content" json:"content" binding:"required"` Commit CommitForm `form:"commit,omitempty" json:"commit,omitempty"` }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) CreateBranch ¶ added in v0.1.0
func (*Handler) CreateFile ¶ added in v0.1.0
func (*Handler) DeleteBranch ¶ added in v0.1.0
func (*Handler) DeleteFile ¶ added in v0.1.0
func (*Handler) GetBranches ¶
func (*Handler) GetCommits ¶
func (*Handler) GetRepositories ¶
func (*Handler) GetRepository ¶
func (*Handler) UpdateFile ¶ added in v0.1.0
type StatusError ¶ added in v0.1.2
Click to show internal directories.
Click to hide internal directories.