gitlab

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadProjectURL = errors.New("bad project url")
)
View Source
var (
	ErrMissingIdentityToken = errors.New("missing identity token")
)

Functions

func Issues

func Issues(ctx context.Context, client *gitlab.Client, pid string, since time.Time) <-chan *gitlab.Issue

Issues returns a channel with gitlab project issues, ascending order.

func LabelEvents

func LabelEvents(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue) <-chan Event

LabelEvents returns a channel with label events.

func Notes

func Notes(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue) <-chan Event

Notes returns a channel with note events

func SortedEvents

func SortedEvents(inputs ...<-chan Event) chan Event

SortedEvents fan-in some Event-channels into one, sorted by creation date, using CreatedAt-method. This function assume that each channel is pre-ordered.

func StateEvents

func StateEvents(ctx context.Context, client *gitlab.Client, issue *gitlab.Issue) <-chan Event

StateEvents returns a channel with state change events.

Types

type ErrorEvent

type ErrorEvent struct {
	Err  error
	Time time.Time
}

func (ErrorEvent) CreatedAt

func (e ErrorEvent) CreatedAt() time.Time

func (ErrorEvent) ID

func (e ErrorEvent) ID() string

func (ErrorEvent) Kind

func (e ErrorEvent) Kind() EventKind

func (ErrorEvent) UserID

func (e ErrorEvent) UserID() int

type Event

type Event interface {
	ID() string
	UserID() int
	Kind() EventKind
	CreatedAt() time.Time
}

Event represents a unified GitLab event (note, label or state event).

type EventKind

type EventKind int
const (
	EventUnknown EventKind = iota
	EventError
	EventComment
	EventTitleChanged
	EventDescriptionChanged
	EventClosed
	EventReopened
	EventLocked
	EventUnlocked
	EventChangedDuedate
	EventRemovedDuedate
	EventAssigned
	EventUnassigned
	EventChangedMilestone
	EventRemovedMilestone
	EventAddLabel
	EventRemoveLabel
	EventMentionedInIssue
	EventMentionedInMergeRequest
	EventMentionedInCommit
)

type Gitlab

type Gitlab struct{}

func (*Gitlab) Configure

func (g *Gitlab) Configure(repo *cache.RepoCache, params core.BridgeParams, interactive bool) (core.Configuration, error)

func (*Gitlab) LoginMetaKey

func (g *Gitlab) LoginMetaKey() string

func (Gitlab) NewExporter

func (Gitlab) NewExporter() core.Exporter

func (Gitlab) NewImporter

func (Gitlab) NewImporter() core.Importer

func (Gitlab) Target

func (Gitlab) Target() string

func (*Gitlab) ValidParams

func (g *Gitlab) ValidParams() map[string]interface{}

func (*Gitlab) ValidateConfig

func (g *Gitlab) ValidateConfig(conf core.Configuration) error

type LabelEvent

type LabelEvent struct{ gitlab.LabelEvent }

func (LabelEvent) CreatedAt

func (l LabelEvent) CreatedAt() time.Time

func (LabelEvent) ID

func (l LabelEvent) ID() string

func (LabelEvent) Kind

func (l LabelEvent) Kind() EventKind

func (LabelEvent) UserID

func (l LabelEvent) UserID() int

type NoteEvent

type NoteEvent struct{ gitlab.Note }

func (NoteEvent) CreatedAt

func (n NoteEvent) CreatedAt() time.Time

func (NoteEvent) ID

func (n NoteEvent) ID() string

func (NoteEvent) Kind

func (n NoteEvent) Kind() EventKind

func (NoteEvent) Title

func (n NoteEvent) Title() (string, error)

func (NoteEvent) UserID

func (n NoteEvent) UserID() int

type StateEvent

type StateEvent struct{ gitlab.StateEvent }

func (StateEvent) CreatedAt

func (s StateEvent) CreatedAt() time.Time

func (StateEvent) ID

func (s StateEvent) ID() string

func (StateEvent) Kind

func (s StateEvent) Kind() EventKind

func (StateEvent) UserID

func (s StateEvent) UserID() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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