github

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMinimizedReason added in v0.2.0

func GetMinimizedReason(reason string) (githubv4.ReportedContentClassifiers, bool)

func String

func String(s string) *string

Types

type Answer

type Answer struct {
	ID          string
	Body        string
	CreatedAt   string
	UpvoteCount int
	Author      *User
	Reactions   *Reactions `graphql:"reactions(first:100)"`
	IsAnswer    bool
}

type Category

type Category struct {
	Name  string
	Emoji string
}

type Client

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

func New

func New(ctx context.Context, token string) *Client

func (*Client) CloseDiscussion added in v0.2.0

func (c *Client) CloseDiscussion(ctx context.Context, id string, reason githubv4.DiscussionCloseReason) error

func (*Client) CloseIssue

func (c *Client) CloseIssue(ctx context.Context, owner, name string, number int) error

func (*Client) CreateDiscussionComment added in v0.2.0

func (c *Client) CreateDiscussionComment(ctx context.Context, id, body string) error

func (*Client) CreateIssue

func (c *Client) CreateIssue(ctx context.Context, owner, repo string, req *github.IssueRequest) (int, string, error)

func (*Client) CreateIssueComment

func (c *Client) CreateIssueComment(ctx context.Context, owner, name string, number int, req *github.IssueComment) (string, error)

func (*Client) GetDiscussion

func (c *Client) GetDiscussion(ctx context.Context, owner, name string, number int) (*Discussion, error)

func (*Client) LockDiscussion added in v0.2.0

func (c *Client) LockDiscussion(ctx context.Context, id string) error

func (*Client) LockIssue

func (c *Client) LockIssue(ctx context.Context, owner, name string, number int, lockReason string) error

func (*Client) MinimizeComment

func (c *Client) MinimizeComment(ctx context.Context, nodeID string, minimizedReason githubv4.ReportedContentClassifiers) error

func (*Client) SearchComments added in v0.2.0

func (c *Client) SearchComments(ctx context.Context, owner, name string, number int, cursor string) ([]*Comment, error)

func (*Client) SearchDiscussionReactions added in v0.2.0

func (c *Client) SearchDiscussionReactions(ctx context.Context, owner, name string, number int, cursor string) ([]*Reaction, error)

func (*Client) SearchDiscussions added in v0.1.1

func (c *Client) SearchDiscussions(ctx context.Context, query string) ([]string, error)

type Comment

type Comment struct {
	ID              string
	Body            string
	URL             string
	MinimizedReason string
	CreatedAt       string
	UpvoteCount     int
	Author          *User
	Reactions       *Reactions `graphql:"reactions(first:100)"`
	Replies         *Replies   `graphql:"replies(first:100)"`
	IsAnswer        bool
	IsMinimized     bool
}

type Comments

type Comments struct {
	TotalCount int
	PageInfo   *PageInfo
	Nodes      []*Comment
}

type Discussion

type Discussion struct {
	ID             string
	Title          string
	Body           string
	URL            string
	Locked         bool
	Closed         bool
	ClosedAt       string
	Labels         *Labels `graphql:"labels(first:100)"`
	Author         *User
	UpvoteCount    int
	Reactions      *Reactions `graphql:"reactions(first:100)"`
	CreatedAt      string
	UpdatedAt      string
	AnswerChosenAt string
	Answer         *Answer
	Category       *Category
	Comments       *Comments `graphql:"comments(first:10)"`
	Poll           *Poll
}

type IssueComment

type IssueComment = github.IssueComment

type IssueRequest

type IssueRequest = github.IssueRequest

type Label

type Label struct {
	Name string
}

type Labels

type Labels struct {
	TotalCount int
	Nodes      []*Label
}

type Option added in v0.1.1

type Option struct {
	Option         string
	TotalVoteCount int
}

type Options added in v0.1.1

type Options struct {
	Nodes []*Option
}

type PageInfo added in v0.2.0

type PageInfo struct {
	HasNextPage bool
	EndCursor   string
}

type Poll added in v0.1.1

type Poll struct {
	Question       string
	TotalVoteCount int
	Options        *Options `graphql:"options(first:100)"`
}

type Query

type Query struct {
	Repository *Repository `graphql:"repository(owner: $repoOwner, name: $repoName)"`
}

type Reaction

type Reaction struct {
	Content string
}

type Reactions

type Reactions struct {
	TotalCount int
	PageInfo   *PageInfo
	Nodes      []*Reaction
}

type Replies

type Replies struct {
	TotalCount int
	Nodes      []*Reply
}

type Reply

type Reply struct {
	ID              string
	Body            string
	URL             string
	MinimizedReason string
	CreatedAt       string
	UpvoteCount     int
	Reactions       *Reactions `graphql:"reactions(first:100)"`
	Author          *User
	IsAnswer        bool
	IsMinimized     bool
}

type Repository

type Repository struct {
	Discussion *Discussion `graphql:"discussion(number: $number)"`
}

type SearchCommentQuery added in v0.2.0

type SearchCommentQuery struct {
	Repository struct {
		Discussion struct {
			Comments *Comments `graphql:"comments(first:10, after: $cursor)"`
		}
	} `graphql:"repository(owner: $repoOwner, name: $repoName)"`
}

type SearchDiscussionReactionsQuery added in v0.2.0

type SearchDiscussionReactionsQuery struct {
	Repository struct {
		Discussion struct {
			Reactions *Reactions `graphql:"reactions(first:100, after: $cursor)"`
		}
	} `graphql:"repository(owner: $repoOwner, name: $repoName)"`
}

type SearchQuery added in v0.1.1

type SearchQuery struct {
	Search struct {
		DiscussionCount int
		PageInfo        *PageInfo
		Nodes           []struct {
			Discussion struct {
				URL string
			} `graphql:"... on Discussion"`
		}
	} `graphql:"search(type:DISCUSSION, query: $query, first:100, after: $cursor)"`
}

type User

type User struct {
	Login     string
	AvatarURL string
}

Jump to

Keyboard shortcuts

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