Documentation ¶
Index ¶
- func EscapedPath(next http.Handler) http.Handler
- type RouteContext
- func (c *RouteContext) Commit(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Error(w http.ResponseWriter, code int)
- func (c *RouteContext) GitInfoRefs(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) GitUploadPack(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Handler() http.Handler
- func (c *RouteContext) Index(w http.ResponseWriter, _ *http.Request)
- func (c *RouteContext) InternalServerError(w http.ResponseWriter)
- func (c *RouteContext) Log(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) NotFound(w http.ResponseWriter)
- func (c *RouteContext) Patch(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Raw(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Refs(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Render(name string, w http.ResponseWriter, code int, data any)
- func (c *RouteContext) Summary(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Tag(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) Tree(w http.ResponseWriter, r *http.Request)
- func (c *RouteContext) WriteText(w http.ResponseWriter, code int, data []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RouteContext ¶
RouteContext stores the necessary things for handling requests.
func NewRouteContext ¶
func NewRouteContext(cfg *config.Config) (*RouteContext, error)
NewRouteContext returns a new RouteContext.
func (*RouteContext) Commit ¶
func (c *RouteContext) Commit(w http.ResponseWriter, r *http.Request)
Commit displays the message and textual diff of a commit.
func (*RouteContext) Error ¶
func (c *RouteContext) Error(w http.ResponseWriter, code int)
Error writes an HTML error page with the given HTTP status code.
func (*RouteContext) GitInfoRefs ¶
func (c *RouteContext) GitInfoRefs(w http.ResponseWriter, r *http.Request)
GitInfoRefs sends the list of remote references in a repository.
func (*RouteContext) GitUploadPack ¶
func (c *RouteContext) GitUploadPack(w http.ResponseWriter, r *http.Request)
GitUploadPack sends a packfile containing the missing git objects that were requested by the client.
func (*RouteContext) Handler ¶
func (c *RouteContext) Handler() http.Handler
Handler returns an http.Handler using the receiving context.
func (*RouteContext) Index ¶
func (c *RouteContext) Index(w http.ResponseWriter, _ *http.Request)
Index lists all repositories under the configuration's repository directory.
func (*RouteContext) InternalServerError ¶
func (c *RouteContext) InternalServerError(w http.ResponseWriter)
InternalServerError calls c.Error with status code 500.
func (*RouteContext) Log ¶
func (c *RouteContext) Log(w http.ResponseWriter, r *http.Request)
Log displays the commit history of a reference, tree, or blob.
func (*RouteContext) NotFound ¶
func (c *RouteContext) NotFound(w http.ResponseWriter)
NotFound calls c.Error with status code 404.
func (*RouteContext) Patch ¶
func (c *RouteContext) Patch(w http.ResponseWriter, r *http.Request)
Patch displays the patch set for a commit in plain text.
func (*RouteContext) Raw ¶
func (c *RouteContext) Raw(w http.ResponseWriter, r *http.Request)
Raw displays the content of a file in plain text.
func (*RouteContext) Refs ¶
func (c *RouteContext) Refs(w http.ResponseWriter, r *http.Request)
Refs lists all tags and branches in a repository.
func (*RouteContext) Render ¶
func (c *RouteContext) Render(name string, w http.ResponseWriter, code int, data any)
Render renders the given data with to w with the given HTTP status code. If an error occurs, it responses with the internal server error message.
func (*RouteContext) Summary ¶
func (c *RouteContext) Summary(w http.ResponseWriter, r *http.Request)
Summary displays the general information of a repository.
func (*RouteContext) Tag ¶
func (c *RouteContext) Tag(w http.ResponseWriter, r *http.Request)
Tag displays the information of an annotated tag.
func (*RouteContext) Tree ¶
func (c *RouteContext) Tree(w http.ResponseWriter, r *http.Request)
Tree displays a tree or a blob object from a reference.
func (*RouteContext) WriteText ¶
func (c *RouteContext) WriteText(w http.ResponseWriter, code int, data []byte)
WriteText writes the given data to w with the text/plain media type.