status

package
v2.0.0-...-98537dd Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdStatus

func NewCmdStatus(f *cmdutil.Factory, runF func(*StatusOptions) error) *cobra.Command

Types

type Event

type Event struct {
	Type string
	Org  struct {
		Login string
	}
	CreatedAt time.Time `json:"created_at"`
	Repo      struct {
		Name string // owner/repo
	}
	Payload struct {
		Action      string
		Issue       IssueOrPR
		PullRequest IssueOrPR `json:"pull_request"`
		Comment     struct {
			Body    string
			HTMLURL string `json:"html_url"`
		}
	}
}

type IssueOrPR

type IssueOrPR struct {
	Number int
	Title  string
}

type Notification

type Notification struct {
	Reason  string
	Subject struct {
		Title            string
		LatestCommentURL string `json:"latest_comment_url"`
		URL              string
		Type             string
	}
	Repository struct {
		Owner struct {
			Login string
		}
		FullName string `json:"full_name"`
	}
	// contains filtered or unexported fields
}

type Results

type Results []SearchResult

func (Results) Len

func (rs Results) Len() int

func (Results) Less

func (rs Results) Less(i, j int) bool

func (Results) Swap

func (rs Results) Swap(i, j int)

type SearchResult

type SearchResult struct {
	Type       string `json:"__typename"`
	UpdatedAt  time.Time
	Title      string
	Number     int
	Repository struct {
		NameWithOwner string
	}
}

type StatusGetter

type StatusGetter struct {
	Client *http.Client

	Org            string
	Exclude        []string
	AssignedPRs    []StatusItem
	AssignedIssues []StatusItem
	Mentions       []StatusItem
	ReviewRequests []StatusItem
	RepoActivity   []StatusItem
	// contains filtered or unexported fields
}

func NewStatusGetter

func NewStatusGetter(client *http.Client, hostname string, opts *StatusOptions) *StatusGetter

func (*StatusGetter) ActualMention

func (s *StatusGetter) ActualMention(commentURL string) (string, error)

func (*StatusGetter) CachedClient

func (s *StatusGetter) CachedClient(ttl time.Duration) *http.Client

func (*StatusGetter) CurrentUsername

func (s *StatusGetter) CurrentUsername() (string, error)

func (*StatusGetter) HasAuthErrors

func (s *StatusGetter) HasAuthErrors() bool

func (*StatusGetter) LoadEvents

func (s *StatusGetter) LoadEvents() error

Populate .RepoActivity

func (*StatusGetter) LoadNotifications

func (s *StatusGetter) LoadNotifications() error

Populate .Mentions

func (*StatusGetter) LoadSearchResults

func (s *StatusGetter) LoadSearchResults() error

Populate .AssignedPRs, .AssignedIssues, .ReviewRequests

func (*StatusGetter) ShouldExclude

func (s *StatusGetter) ShouldExclude(repo string) bool

type StatusItem

type StatusItem struct {
	Repository string // owner/repo
	Identifier string // eg ungtb10d/cli#1234 or just 1234

	Reason string // only used in repo activity
	// contains filtered or unexported fields
}

func (StatusItem) Preview

func (s StatusItem) Preview() string

type StatusOptions

type StatusOptions struct {
	HttpClient   func() (*http.Client, error)
	HostConfig   hostConfig
	CachedClient func(*http.Client, time.Duration) *http.Client
	IO           *iostreams.IOStreams
	Org          string
	Exclude      []string
}

Jump to

Keyboard shortcuts

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