models

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenState   = "open"
	ClosedState = "closed"
)

Pull request states

View Source
const (
	Slack   = "slack"
	Webhook = "webhook"
	None    = "none"
)

Variables

View Source
var Valid = []string{Slack, Webhook, None}

Functions

This section is empty.

Types

type Config added in v1.3.1

type Config struct {
	Messages Messages `yaml:"messages"`
}

type Feathers added in v1.3.1

type Feathers struct {
	Teams  Teams  `yaml:"teams"`
	Config Config `yaml:"config"`
}

type GetReleasesResponse added in v1.7.0

type GetReleasesResponse struct {
	Releases []Release `json:"releases"`
}

type Messages added in v1.3.1

type Messages struct {
	Subject string `yaml:"subject"`
}

type PullRequestEventDTO

type PullRequestEventDTO struct {
	PullRequestID int64
	PROwner       string
	RepoOwner     string
	RepoName      string
	Body          string
	PRNumber      int
	SHA           string
	Branch        string
	DefaultBranch string
}

PullRequestEventDTO is a data transfer object for the PullRequestEvent & IssueCommentEvent. It reduces the amount of data that is held by the service.

func MarshalIssueCommentCreatedEvent added in v1.10.0

func MarshalIssueCommentCreatedEvent(event *github.IssueCommentEvent) *PullRequestEventDTO

MarshalIssueCommentCreatedEvent marshals a github.IssueCommentEvent into a PullRequestEventDTO

func MarshalPullRequestEvent

func MarshalPullRequestEvent(event *github.PullRequestEvent) *PullRequestEventDTO

MarshalPullRequestEvent marshals a github.PullRequestEvent into a PullRequestEventDTO

func (*PullRequestEventDTO) Summary added in v1.7.0

type PullRequestSummary added in v1.7.0

type PullRequestSummary struct {
	PRNumber  int
	RepoOwner string
	RepoName  string
}

PullRequestSummary is a summary of the PR details to be stored alongside release notes

type Release added in v1.7.0

type Release struct {
	CreatedAt    time.Time          `json:"createdAt" bson:"createdAt"`
	ReleaseNotes []ReleaseNote      `json:"releaseNotes" bson:"releaseNotes"`
	Environment  string             `json:"environment" bson:"environment"`
	PullRequest  PullRequestSummary `json:"pullRequest" bson:"pullRequest"`
}

type ReleaseNote added in v1.1.1

type ReleaseNote struct {
	Teams   Teams
	Content string
}

func (*ReleaseNote) AppendContent added in v1.13.0

func (r *ReleaseNote) AppendContent(content string)

func (*ReleaseNote) AreTeamsEqual added in v1.13.0

func (r *ReleaseNote) AreTeamsEqual(other ReleaseNote) bool

type Team added in v1.3.1

type Team struct {
	Name        string   `yaml:"name"`
	APIKey      string   `yaml:"apiKey"`
	ContactType string   `yaml:"contactType"`
	Addresses   []string `yaml:"addresses"`
}

type Teams added in v1.3.1

type Teams []Team

func (Teams) Contains added in v1.3.2

func (ts Teams) Contains(teamNames ...string) error

func (Teams) GetAddressPool added in v1.3.2

func (ts Teams) GetAddressPool() map[string][]string

func (Teams) GetAllContactTypes added in v1.3.1

func (ts Teams) GetAllContactTypes() []string

func (Teams) GetAllTeamNames added in v1.3.1

func (ts Teams) GetAllTeamNames() []string

func (Teams) GetContactTypesByTeamNames added in v1.3.1

func (ts Teams) GetContactTypesByTeamNames(names ...string) []string

func (Teams) GetTeamsByNames added in v1.3.1

func (ts Teams) GetTeamsByNames(names ...string) Teams

Jump to

Keyboard shortcuts

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