api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RawMimeTypes string = "application/vnd.giteway.raw"
)

Variables

This section is empty.

Functions

func Routes

func Routes(r *gin.Engine, h *Handler)

Types

type CommitForm added in v0.1.0

type CommitForm struct {
	Message *string `form:"message,omitempty" json:"message,omitempty"`
}

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 {
	RepoURI
	Branch string `uri:"branch" binding:"required"`
}

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 FileURI

type FileURI struct {
	RepoURI
	Path string `uri:"path,default=/"`
}

type Handler

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

func NewHandler

func NewHandler(c *config.Config, e *gin.Engine) *Handler

func (*Handler) CreateBranch added in v0.1.0

func (h *Handler) CreateBranch(ctx *gin.Context)

Create a branch with name @Summary Create a branch with name.

func (*Handler) CreateFile added in v0.1.0

func (h *Handler) CreateFile(ctx *gin.Context)

Create file @Summary Create file.

func (*Handler) DeleteBranch added in v0.1.0

func (h *Handler) DeleteBranch(ctx *gin.Context)

Delete a branch by name @Summary Delete a branch by name.

func (*Handler) DeleteFile added in v0.1.0

func (h *Handler) DeleteFile(ctx *gin.Context)

Delete file @Summary Delete file.

func (*Handler) GetBranches

func (h *Handler) GetBranches(ctx *gin.Context)

Get branches list @Summary Get branches list.

func (*Handler) GetCommits

func (h *Handler) GetCommits(ctx *gin.Context)

Get commits list @Summary Get commits list.

func (*Handler) GetFiles

func (h *Handler) GetFiles(ctx *gin.Context)

Get files list @Summary Get files list.

func (*Handler) GetRepositories

func (h *Handler) GetRepositories(ctx *gin.Context)

Get repositories list @Summary Get repositories list.

func (*Handler) GetRepository

func (h *Handler) GetRepository(ctx *gin.Context)

Get repository details. @Summary Get repository details.

func (*Handler) UpdateFile added in v0.1.0

func (h *Handler) UpdateFile(ctx *gin.Context)

Update file @Summary Update file.

type OwnerUri added in v0.1.0

type OwnerUri struct {
	Hosting string `uri:"hosting" binding:"required"`
	Owner   string `uri:"owner" binding:"required"`
}

type RefForm added in v0.1.0

type RefForm struct {
	Ref    *string `form:"ref,omitempty"`
	SHA    *string `form:"sha,omitempty"`
	Branch string  `form:"branch,default=main"`
}

type RepoURI

type RepoURI struct {
	OwnerUri
	Name string `uri:"name" binding:"required"`
}

Jump to

Keyboard shortcuts

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