types

package
v0.0.0-...-05b5a7e Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	CanLabel bool   `json:"can_label" yaml:"can_label"`
	MemberOf string `json:"member_of,omitempty" yaml:"member_of,omitempty"`
}

Author --

type AuthorMember

type AuthorMember struct {
	Source    string `json:"source" yaml:"source"`
	Condition string `json:"condition" yaml:"condition"`
	SourceID  int    `json:"source_id" yaml:"source_id"`
}

AuthorMember --

type Duration

type Duration struct {
	time.Duration
}

Duration --

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON --

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON --

type Filter

type Filter struct {
	Name       string          `json:"name" yaml:"name"`
	Relation   string          `json:"relation" yaml:"relation" default:"self"`
	Conditions *RuleConditions `json:"conditions" yaml:"conditions"`
	Action     string          `json:"action" yaml:"action" default:"include"`
}

Filter --

func (*Filter) GroupEpics

func (f *Filter) GroupEpics(opts *Options, epics []*gitlab.Epic, log *logrus.Entry) ([]*gitlab.Epic, error)

GroupEpics filters Epics based on additional conditions not supported by the API

func (*Filter) GroupMilestones

func (f *Filter) GroupMilestones(opts *Options, milestones []*gitlab.GroupMilestone, log *logrus.Entry) ([]*gitlab.GroupMilestone, error)

GroupMilestones --

type Options

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

Options --

func NewOptions

func NewOptions(client *gitlab.Client, sourceType, sourceID string, dryrun bool) *Options

NewOptions --

type Policy

type Policy struct {
	ResourceRules *ResourceRules `json:"resource_rules" yaml:"resource_rules"`
}

Policy --

type ResourcePolicy

type ResourcePolicy struct {
	Rules []Rule `json:"rules" yaml:"rules"`
}

ResourcePolicy --

type ResourceRules

type ResourceRules struct {
	Epics         *ResourcePolicy `json:"epics,omitempty" yaml:"epics,omitempty"`
	Issues        *ResourcePolicy `json:"issues,omitempty" yaml:"issues,omitempty"`
	MergeRequests *ResourcePolicy `json:"merge_requests,omitempty" yaml:"merge_requests,omitempty"`
	Milestones    *ResourcePolicy `json:"milestones,omitempty" yaml:"milestones,omitempty"`
}

ResourceRules --

func (*ResourceRules) Process

func (r *ResourceRules) Process(opts *Options) error

Process --

type Rule

type Rule struct {
	Name       string          `json:"name" yaml:"name"`
	Conditions *RuleConditions `json:"conditions" yaml:"conditions"`
	Actions    *RuleActions    `json:"actions" yaml:"actions"`
	Limits     *RuleLimits     `json:"limits,omitempty" yaml:"limits,omitempty"`

	// Allow for embedding additional rules, only applies for epics, milestone
	Epics         *ResourcePolicy `json:"epics,omitempty" yaml:"epics,omitempty"`
	Issues        *ResourcePolicy `json:"issues,omitempty" yaml:"issues,omitempty"`
	MergeRequests *ResourcePolicy `json:"merge_requests,omitempty" yaml:"merge_requests,omitempty"`

	Filters []*Filter `json:"filters,omitempty" yaml:"filters,omitempty"`
}

Rule --

func (*Rule) Comment

func (rule *Rule) Comment(opts *Options, entity interface{}) error

Comment --

func (*Rule) FilterGroupEpics

func (r *Rule) FilterGroupEpics(opts *Options, epics []*gitlab.Epic, log *logrus.Entry) ([]*gitlab.Epic, error)

FilterGroupEpics --

func (*Rule) FilterGroupMilestones

func (r *Rule) FilterGroupMilestones(opts *Options, milestones []*gitlab.GroupMilestone, log *logrus.Entry) ([]*gitlab.GroupMilestone, error)

FilterGroupMilestones --

func (*Rule) GenerateGroupIssueOptions

func (rule *Rule) GenerateGroupIssueOptions() *gitlab.ListGroupIssuesOptions

GenerateGroupIssueOptions --

func (*Rule) GenerateGroupMergeRequestsOptions

func (rule *Rule) GenerateGroupMergeRequestsOptions() *gitlab.ListGroupMergeRequestsOptions

GenerateGroupMergeRequestsOptions --

func (*Rule) GenerateLimits

func (rule *Rule) GenerateLimits() gitlab.ListOptions

GenerateLimits --

func (*Rule) GenerateListGroupEpicsOptions

func (rule *Rule) GenerateListGroupEpicsOptions() *gitlab.ListGroupEpicsOptions

GenerateListGroupEpicsOptions --

func (*Rule) GenerateListGroupMilestonesOptions

func (rule *Rule) GenerateListGroupMilestonesOptions() *gitlab.ListGroupMilestonesOptions

GenerateListGroupMilestonesOptions --

func (*Rule) GenerateListProjectIssuesOptions

func (rule *Rule) GenerateListProjectIssuesOptions() *gitlab.ListProjectIssuesOptions

GenerateListProjectIssuesOptions --

func (*Rule) GenerateProjectMergeRequestsOptions

func (rule *Rule) GenerateProjectMergeRequestsOptions() *gitlab.ListProjectMergeRequestsOptions

GenerateProjectMergeRequestsOptions --

func (*Rule) Label

func (rule *Rule) Label(opts *Options, entity interface{}) error

Label --

func (*Rule) ProcessEpics

func (r *Rule) ProcessEpics(opts *Options) error

ProcessEpics --

func (*Rule) ProcessIssues

func (r *Rule) ProcessIssues(opts *Options) error

ProcessIssues --

func (*Rule) ProcessMergeRequests

func (r *Rule) ProcessMergeRequests(opts *Options) error

ProcessMergeRequests --

func (*Rule) ProcessMilestones

func (r *Rule) ProcessMilestones(opts *Options) ([]Rule, error)

ProcessMilestones --

func (*Rule) State

func (rule *Rule) State(opts *Options, entity interface{}) error

State changes state of a Gitlab entity

func (*Rule) Summarize

func (rule *Rule) Summarize(opts *Options, issues []*gitlab.Issue) error

Summarize --

func (*Rule) Unlabel

func (rule *Rule) Unlabel(opts *Options, entity interface{}) error

Unlabel --

type RuleActionSummarize

type RuleActionSummarize struct {
	Title       string `json:"title" yaml:"title"`
	Item        string `json:"item" yaml:"item"`
	Summary     string `json:"summary" yaml:"summary"`
	Destination string `json:"destination" yaml:"destination"`
}

RuleActionSummarize --

type RuleActions

type RuleActions struct {
	State       *string              `json:"state,omitempty" yaml:"state,omitempty"`
	Labels      []string             `json:"labels,omitempty" yaml:"labels,omitempty"`
	Unlabel     []string             `json:"unlabel,omitempty" yaml:"unlabel,omitempty"`
	Comment     *string              `json:"comment,omitempty" yaml:"comment,omitempty"`
	CommentType *string              `json:"comment_type,omitempty" yaml:"comment_type,omitempty"`
	Summarize   *RuleActionSummarize `json:"summarize,omitempty" yaml:"summarize,omitempty"`
}

RuleActions --

type RuleConditionDate

type RuleConditionDate struct {
	Condition string   `json:"condition" yaml:"condition"`
	Duration  Duration `json:"duration" yaml:"duration"`
}

RuleConditionDate --

type RuleConditions

type RuleConditions struct {
	State           string             `json:"state" yaml:"state"`
	Labels          []string           `json:"labels,omitempty" yaml:"labels,omitempty"`
	IgnoredLabels   []string           `json:"ignored_labels,omitempty" yaml:"ignored_labels,omitempty"`
	MissingLabels   []string           `json:"missing_labels,omitempty" yaml:"missing_labels,omitempty"`
	ForbiddenLabels []string           `` /* 134-byte string literal not displayed */
	AuthorMember    *AuthorMember      `json:"author_member,omitempty" yaml:"author_member,omitempty"`
	Author          *Author            `json:"author,omitempty" yaml:"author,omitempty"`
	Date            *RuleConditionDate `json:"date,omitempty" yaml:"date,omitempty"`
	Weight          string             `json:"weight,omitempty" yaml:"weight,omitempty"`
	Milestone       string             `json:"milestone,omitempty" yaml:"milestone,omitempty"`
	Expired         bool               `json:"expired,omitempty" yaml:"expired,omitempty" comment:"Only valid for filters for milestones"`

	// Epic Only
	FixedDates bool `json:"fixed_dates,omitempty" yaml:"fixed_dates,omitempty" resource:"epic" comment:"Only valid for filters for epics"`
}

RuleConditions --

type RuleLimits

type RuleLimits struct {
	MostRecent *int `json:"most_recent,omitempty" yaml:"most_recent,omitempty"`
	PerPage    *int `json:"per_page,omitempty" yaml:"per_page,omitempty"`
}

RuleLimits --

type Summary

type Summary struct {
	Options *gitlab.CreateIssueOptions
	Project string
}

Summary --

Jump to

Keyboard shortcuts

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