github

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitRepo

func SplitRepo(repo string) (string, string)

Types

type GQLAssociatedPRs

type GQLAssociatedPRs struct {
	Nodes []GQLPRNode `json:"nodes"`
}

type GQLAuthor

type GQLAuthor struct {
	Login string `json:"login"`
}

type GQLClient

type GQLClient struct {
	Token string
	Cl    *github.Client
}

func GqlClientFromEnv

func GqlClientFromEnv() *GQLClient

func (GQLClient) CommitByRef

func (c GQLClient) CommitByRef(repo, tag string) (string, error)

func (GQLClient) HistoryGraphQl

func (c GQLClient) HistoryGraphQl(repo, branch, commitLimit string) ([]GQLCommit, error)

func (GQLClient) ReleaseGraphQL

func (c GQLClient) ReleaseGraphQL(repo string) ([]GQLRelease, error)

func (GQLClient) UpsertRelease

func (c GQLClient) UpsertRelease(ctx context.Context, repo string, release string, contentModifier func(repositoryRelease *github.RepositoryRelease) error) error

type GQLCommit

type GQLCommit struct {
	Oid                    string           `json:"oid"`
	Message                string           `json:"message"`
	AssociatedPullRequests GQLAssociatedPRs `json:"associatedPullRequests"`
}

type GQLData

type GQLData struct {
	Repository GQLRepo `json:"repository"`
}

type GQLHistoryRepo

type GQLHistoryRepo struct {
	PageInfo GQLPageInfo `json:"pageInfo"`
	Nodes    []GQLCommit `json:"nodes"`
}

type GQLObjectRelease

type GQLObjectRelease struct {
	Nodes []GQLRelease `json:"nodes"`
}

type GQLObjectRepo

type GQLObjectRepo struct {
	History GQLHistoryRepo `json:"history"`
}

type GQLOutput

type GQLOutput struct {
	Data GQLData `json:"data"`
}

type GQLPRNode

type GQLPRNode struct {
	Author GQLAuthor `json:"author"`
	Number int       `json:"number"`
	Title  string    `json:"title"`
	Body   string    `json:"body"`
}

type GQLPageInfo

type GQLPageInfo struct {
	HasNextPage bool   `json:"hasNextPage"`
	EndCursor   string `json:"endCursor"`
}

type GQLRef

type GQLRef struct {
	Target GQLRefTarget `json:"target"`
}

type GQLRefTarget

type GQLRefTarget struct {
	CommitUrl string `json:"commitUrl"`
	Oid       string `json:"oid"`
}

func (GQLRefTarget) Commit added in v0.7.0

func (r GQLRefTarget) Commit() string

type GQLRelease

type GQLRelease struct {
	Name         string    `json:"name"`
	CreatedAt    time.Time `json:"createdAt"`
	PublishedAt  time.Time `json:"publishedAt"`
	IsDraft      bool      `json:"isDraft"`
	IsPrerelease bool      `json:"isPrerelease"`
	Description  string    `json:"description"`
	Id           int       `json:"databaseId"`
	IsLatest     bool      `json:"isLatest"`
}

func (GQLRelease) Branch added in v0.6.0

func (r GQLRelease) Branch() string

Branch branch that this release was first on

func (GQLRelease) ExtractReleaseDate added in v0.6.0

func (r GQLRelease) ExtractReleaseDate() (time.Time, error)

ExtractReleaseDate returns the date this was published, if there's a `> Released on YYYY/MM/DD` in the description it uses this, otherwise it uses the PublishedAt data from Github.

func (GQLRelease) IsReleased added in v0.6.0

func (r GQLRelease) IsReleased() bool

IsReleased returns if the release in not prerelease not a draft

func (GQLRelease) SemVer added in v0.10.0

func (r GQLRelease) SemVer() *semver.Version

type GQLRepo

type GQLRepo struct {
	Ref      GQLRef           `json:"ref"`
	Object   GQLObjectRepo    `json:"object"`
	Releases GQLObjectRelease `json:"releases"`
}

Jump to

Keyboard shortcuts

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