storage

package
v0.0.0-...-b4abb51 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubInstallation

type GitHubInstallation struct {
	InstallationID int64  // https://github.com/settings/installations/<InstallationID>
	AccountName    string // https://github/<AccountName>. Org or user account.
	AccountID      int64  // GitHub ID of <AccountName>.
}

GitHubInstallation represents GitHub Apps Installation data. Installation is per org or user account, not repository.

type GitHubInstallationDatastore

type GitHubInstallationDatastore struct{}

GitHubInstallationDatastore is store of GitHubInstallation by Datastore of Google Appengine.

func (*GitHubInstallationDatastore) Get

func (g *GitHubInstallationDatastore) Get(ctx context.Context, accountName string) (ok bool, inst *GitHubInstallation, err error)

func (*GitHubInstallationDatastore) Put

Put save GitHubInstallation. It reduces datastore write call as much as possible.

type GitHubInstallationStore

type GitHubInstallationStore interface {
	// Put upserts GitHub InstallationID entity. If InstallationID is not
	// updated, the whole entity won't be saved.
	Put(ctx context.Context, inst *GitHubInstallation) error
	// Get get GitHubInstallation entity by account name.
	// - If the entity is found, return inst with ok is true.
	// - If the entity is not found, ok is false.
	// - If error occurs, it returns err.
	Get(ctx context.Context, accountName string) (ok bool, inst *GitHubInstallation, err error)
}

GitHubInstallationStore represents GitHubInstallation storage interface.

type GitHubRepoTokenDatastore

type GitHubRepoTokenDatastore struct{}

GitHubRepoTokenDatastore is store of GitHubRepositoryToken by Datastore of Google Appengine.

func (*GitHubRepoTokenDatastore) Get

func (g *GitHubRepoTokenDatastore) Get(ctx context.Context, owner, repo string) (ok bool, token *GitHubRepositoryToken, err error)

func (*GitHubRepoTokenDatastore) Put

Put upserts GitHubRepositoryToken.

type GitHubRepositoryToken

type GitHubRepositoryToken struct {
	Token string
	// https://github/<RepositoryOwner>/<RepositoryName>.
	RepositoryOwner string
	RepositoryName  string
	RepositoryID    int64
}

GitHubRepositoryToken represents token data for authenticating reviewdog CLI to the target repository.

type GitHubRepositoryTokenStore

type GitHubRepositoryTokenStore interface {
	// Put upserts GitHubRepositoryToken entity.
	Put(ctx context.Context, token *GitHubRepositoryToken) error
	// Get get GitHubRepositoryToken entity by owner and repo name.
	// - If the entity is found, return token with ok is true.
	// - If the entity is not found, ok is false.
	// - If error occurs, it returns err.
	Get(ctx context.Context, owner, repo string) (ok bool, token *GitHubRepositoryToken, err error)
}

GitHubRepositoryTokenStore represents GitHubRepositoryToken storage interface.

Jump to

Keyboard shortcuts

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