Documentation
¶
Index ¶
- func MuxAllowUserID(mux *http.ServeMux, projectID, userID int)
- func MuxAllowUserIDCounting(mux *http.ServeMux, projectID, userID int, counter *int)
- func MuxDisallowUserID(mux *http.ServeMux, projectID, userID int)
- func MuxDiscussionsNote(mux *http.ServeMux, pid, mrID int, author string, authorID int, ...)
- func MuxDiscussionsNoteEmpty(mux *http.ServeMux, pid, mrID int)
- func MuxDiscussionsNoteWithReply(mux *http.ServeMux, pid, mrID int, firstAuthor string, firstAuthorID int, ...)
- func MuxGetFile(mux *http.ServeMux, pid int, fname, content string, wantErr bool)
- func MuxListTektonDir(_ *testing.T, mux *http.ServeMux, pid int, ref, prs string, ...)
- func MuxMergeRequestNote(mux *http.ServeMux, pid, mrID, noteID, userID int, ...)
- func MuxNotePost(t *testing.T, mux *http.ServeMux, projectNumber, mrID int, catchStr string)
- func SetPagingHeader(t *testing.T, rw http.ResponseWriter, req *http.Request, maxPage int) int
- func Setup(t *testing.T) (*gitlab.Client, *http.ServeMux, func())
- type TEvent
- func (t TEvent) CommitNoteEventAsJSON(comment, action, repository string) string
- func (t TEvent) MREventAsJSON(action, extraStuff string) string
- func (t TEvent) MergeCommentEventAsJSON(comment string) string
- func (t TEvent) NoteEventAsJSON(comment string) string
- func (t TEvent) PushEventAsJSON(withcommits bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MuxAllowUserID ¶
func MuxAllowUserIDCounting ¶ added in v0.39.0
MuxAllowUserIDCounting registers a handler that returns an allowed member and increments the provided counter each time it is called. Useful to assert caching behavior.
func MuxDisallowUserID ¶ added in v0.28.0
func MuxDiscussionsNote ¶
func MuxDiscussionsNoteEmpty ¶ added in v0.28.0
func MuxDiscussionsNoteWithReply ¶ added in v0.39.0
func MuxDiscussionsNoteWithReply(mux *http.ServeMux, pid, mrID int, firstAuthor string, firstAuthorID int, firstContent, okAuthor string, okAuthorID int, okContent string)
MuxDiscussionsNoteWithReply returns a single discussion where the first note does not contain the trigger but a subsequent reply does. This simulates /ok-to-test being posted in a thread reply.
func MuxListTektonDir ¶
func MuxMergeRequestNote ¶ added in v0.40.0
func MuxNotePost ¶
func SetPagingHeader ¶ added in v0.40.0
SetPagingHeader sets the gitlab paging header "link" to the next page. If the requested page is equal to or higher than maxPage, no next page header is set. The requested page number is returned.
Types ¶
type TEvent ¶
type TEvent struct {
Username, DefaultBranch, URL, SHA, SHAurl, SHAtitle, Headbranch, Basebranch, HeadURL, BaseURL string
UserID, MRID, TargetProjectID, SourceProjectID, NoteID int
PathWithNameSpace, Comment string
}
func (TEvent) CommitNoteEventAsJSON ¶ added in v0.34.0
func (TEvent) MREventAsJSON ¶
MREventAsJSON returns a JSON string representing the Merge Request event. It includes information about the user, project, and object attributes such as action, iid, source project id, title, source branch, target branch, last commit, target path with namespace, target web url, and source web url.