github

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author added in v1.1.7

type Author struct {
	Name githubv4.String
}

Author represents the information about the commit author

type CheckRunNodes added in v1.1.0

type CheckRunNodes struct {
	Name       githubv4.String
	Status     githubv4.String
	Title      githubv4.String
	Conclusion githubv4.String
}

CheckRunNodes represents the checkRun status of the Nodes

type CheckRuns added in v1.1.0

type CheckRuns struct {
	Nodes []CheckRunNodes
}

CheckRuns represents the check run of an array of Nodes

type CheckSuite added in v1.1.0

type CheckSuite struct {
	Conclusion githubv4.String
}

CheckSuite represents the information about the check suite obtained from Github

type CheckSuiteNode added in v1.1.0

type CheckSuiteNode struct {
	WorkflowRun WorkflowRun
	CheckRuns   CheckRuns `graphql:"checkRuns(first: 25)"`
}

CheckSuiteNode represents the information about the check suite information of the Node

type CheckSuites added in v1.1.0

type CheckSuites struct {
	Nodes []CheckSuiteNode
}

CheckSuites represents the information about the check suite of a slice of Nodes

type Commit

type Commit struct {
	SHA                 string
	Message             string
	Parents             []Commit
	StatusSuccess       bool
	AuthoredDate        time.Time
	AuthorName          string
	SpecificCheckPassed bool
}

Commit represents a specific GitHub commit

func PickFirstParentCommits

func PickFirstParentCommits(fullCommitsList []Commit) []Commit

PickFirstParentCommits recover the first parent commit of a commit history from a repository

type Context added in v1.1.0

type Context struct {
	Context githubv4.String
	State   githubv4.String
}

Context represents the information about the Context

type Edge added in v1.1.0

type Edge struct {
	Node EdgeRootNode
}

Edge represents the information about a edge element

type EdgeNode added in v1.1.0

type EdgeNode struct {
	Oid     githubv4.String
	Message githubv4.String
}

EdgeNode represents the information about an edge node

type EdgeParent added in v1.1.0

type EdgeParent struct {
	Node EdgeNode
}

EdgeParent represents the information about a parent node

type EdgeRootNode added in v1.1.0

type EdgeRootNode struct {
	Parents           ParentsEdge `graphql:"parents(first: $parentsNumber)"`
	Oid               githubv4.String
	Message           githubv4.String
	AuthoredDate      githubv4.DateTime
	Author            Author
	StatusCheckRollup StatusCheckRollup
	CheckSuites       CheckSuites `graphql:"checkSuites(first: 20)"`
	Status            NodeStatus
}

EdgeRootNode represents the information about a edge root node

type Error

type Error struct {
	Message       string
	PreviousError error
}

Error represents a specific error in commit check

func (Error) Error

func (e Error) Error() string

type History added in v1.1.0

type History struct {
	Edges []Edge
}

History represents the information about a slice of Edges

type Manager added in v1.1.0

type Manager struct {
	Context    context.Context
	Client     *githubv4.Client
	HTTPClient *http.Client
}

Manager represents the information necessary in Github to manage the repository

func New

func New(githubAccessToken string) *Manager

New creates a new githubManager using a github access token

func (*Manager) ChangeBranchHead added in v1.1.0

func (gm *Manager) ChangeBranchHead(owner, repo, branch, sha string, force bool) error

ChangeBranchHead change the head of a branch TODO remove v3 client when implemented in v4

func (*Manager) GetCommits added in v1.1.0

func (gm *Manager) GetCommits(owner, repo, branch string, lastCommitsNumber int, specificChecksNames string, sep string) ([]Commit, error)

GetCommits recover the commits for a specific repository in a specific branch

type NodeStatus added in v1.1.0

type NodeStatus struct {
	Contexts []Context
}

NodeStatus represents the information about a slice of Contexts

type ParentsEdge added in v1.1.0

type ParentsEdge struct {
	Edges []EdgeParent
}

ParentsEdge represents the information about the parents edge

type Query added in v1.1.0

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

Query represents the information obtained in a Github Query

type Ref added in v1.1.0

type Ref struct {
	Target Target
}

Ref represents the information about a ref element

type Repository added in v1.1.0

type Repository struct {
	Ref Ref `graphql:"ref(qualifiedName: $branch)"`
}

Repository represents the information obtained about a repository in a Github Query

type StatusCheckRollup added in v1.1.0

type StatusCheckRollup struct {
	State    githubv4.String
	Contexts StatusCheckRollupContexts `graphql:"contexts(first: $parentsNumber)"`
}

StatusCheckRollup represents the information about the status check of rollup

type StatusCheckRollupContexts added in v1.1.0

type StatusCheckRollupContexts struct {
	TotalCount githubv4.Int
}

StatusCheckRollupContexts represents the information about the status check of roullup contexts

type Target added in v1.1.0

type Target struct {
	Commit TargetCommit `graphql:"... on Commit"`
}

Target represents the target of a specific commit

type TargetCommit added in v1.1.0

type TargetCommit struct {
	History History `graphql:"history(first: $commitsNumber)"`
}

TargetCommit represents the information about a commit history

type Workflow added in v1.1.0

type Workflow struct {
	Name githubv4.String
}

Workflow represents the information of the Github Workflow

type WorkflowRun added in v1.1.0

type WorkflowRun struct {
	Workflow   Workflow
	CheckSuite CheckSuite
}

WorkflowRun represents the information about the workflow run execution

Jump to

Keyboard shortcuts

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