github

package
v0.0.0-...-42283ad Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*gh.Client

	ID             int64
	InstallationID int64
	Owner          string
	Repo           string
}

NewClient returns a new GitHub client for the given installation ID.

func (*App) CreateArticleCommit

func (a *App) CreateArticleCommit(ctx context.Context, slug string, opts ...Option) (string, error)

func (*App) CreateInstallationToken

func (a *App) CreateInstallationToken(ctx context.Context) (string, error)

CreateGithubInstallationToken creates a new GitHub installation token.

func (*App) CreateOrUpdateArticlePullRequest

func (a *App) CreateOrUpdateArticlePullRequest(ctx context.Context, slug string, opts ...Option) (int, string, error)

func (*App) CreateOrUpdatePlacePullRequest

func (a *App) CreateOrUpdatePlacePullRequest(ctx context.Context, slug string, opts ...Option) (int, string, error)

func (*App) FetchArticle

func (a *App) FetchArticle(ctx context.Context, slug string) (*ArticleCheckout, error)

func (*App) FetchPlace

func (a *App) FetchPlace(ctx context.Context, slug string) (*PlaceCheckout, error)

type ArticleCheckout

type ArticleCheckout struct {
	Slug               string
	Article            *citygraph.Article
	BodyHTML           string
	JavascriptFunction string
	LocationsGeoJSON   *geojson.FeatureCollection
}

ArticleCheckout contains the contents of an article read directly from Github.

type Option

type Option func(*Params)

func InArchive

func InArchive(inArchive bool) Option

func WithArticle

func WithArticle(article *citygraph.Article) Option

func WithArticleJS

func WithArticleJS(articleJS string) Option

func WithBodyHTML

func WithBodyHTML(bodyHTML string) Option

func WithCommitMessage

func WithCommitMessage(msg string) Option

func WithLocations

func WithLocations(locations string) Option

func WithPRBody

func WithPRBody(prBody string) Option

func WithPRNum

func WithPRNum(prNum int) Option

func WithPRTitle

func WithPRTitle(prTitle string) Option

func WithPlace

func WithPlace(place *citygraph.Place) Option

func WithTeaserGeoJSON

func WithTeaserGeoJSON(geojson string) Option

func WithTeaserJS

func WithTeaserJS(js string) Option

type Params

type Params struct {
	InArchive     bool
	Article       *citygraph.Article
	Place         *citygraph.Place
	BodyHTML      string
	ArticleJS     string
	Locations     string
	CommitMessage string
	PRTitle       string
	PRBody        string
	PRNum         int
	TeaserGeoJSON string
	TeaserJS      string
}

type PlaceCheckout

type PlaceCheckout struct {
	Slug     string
	Place    *citygraph.Place
	BodyHTML string
}

ArticleCheckout contains the contents of an article read directly from Github.

Jump to

Keyboard shortcuts

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