Version: v0.0.0-...-0f20b9f Latest Latest

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Attributes

type Attributes struct {
	State       string `json:"state"`
	Title       string `json:"title"`
	Description string `json:"description"`
	URL         string `json:"url"`
	Action      string `json:"action"`

Attributes represent things like state, title, url or action

type MergeRequest

type MergeRequest struct {
	Kind       string     `json:"object_kind"`
	Project    Project    `json:"project"`
	Attributes Attributes `json:"object_attributes"`

MergeRequest is the MR object

func (MergeRequest) ProjectName

func (m MergeRequest) ProjectName() string

ProjectName implements Announcement

func (MergeRequest) ShouldAnnounce

func (m MergeRequest) ShouldAnnounce() bool

ShouldAnnounce implements Announcement

func (MergeRequest) Text

func (m MergeRequest) Text() string

Text implements Annoucement

type Parser

type Parser struct {
	// contains filtered or unexported fields

Parser implements the core.Parser type for GitLab merge webhooks

func NewParser

func NewParser(pattern string, secretToken string) Parser

NewParser creates a new parser using the pattern provided

func (Parser) MatchHeaders

func (Parser) MatchHeaders(headers map[string][]string) bool

MatchHeaders indicates that the headers match with the kind of request

func (Parser) Parse

func (p Parser) Parse(headers map[string][]string, payload []byte) (core.Announcement, error)

Parse parses a payload and returns a a valid one if everything is in place for it to be announced

type Project

type Project struct {
	PathWithNamespace string `json:"path_with_namespace"`

Project is used to identify which project it is including the namespace

Source Files

Jump to

Keyboard shortcuts

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