github

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccount

func GetAccount(client request.Doer, accessToken string) (types.Account, error)

GetAccount is a utility function that calls the main Github API and wraps the response so that it can be used with an Account interface

func GetNotifications added in v0.0.6

func GetNotifications(client request.Doer, accessToken string, since ...time.Time) (types.Notifications, error)

GetNotifications returns the serialized version of the Github notifications

Types

type Account

type Account pkg.APIv3UserResponse

Account implements types.Account

func (Account) GetCreatedAt added in v0.0.6

func (a Account) GetCreatedAt() *string

GetCreatedAt implements the internal/types.Account interface

func (Account) GetEmail added in v0.0.6

func (a Account) GetEmail() *string

GetEmail implements the internal/types.Account interface

func (Account) GetFollowerCount added in v0.0.6

func (a Account) GetFollowerCount() *int

GetFollowerCount implements the internal/types.Account interface

func (Account) GetIsAdmin added in v0.0.6

func (a Account) GetIsAdmin() *bool

GetIsAdmin implements the internal/types.Account interface

func (Account) GetLastSeen added in v0.0.6

func (a Account) GetLastSeen() *string

GetLastSeen implements the internal/types.Account interface

func (a Account) GetLink() *string

GetLink implements the internal/types.Account interface

func (Account) GetName added in v0.0.6

func (a Account) GetName() *string

GetName implements the internal/types.Account interface

func (Account) GetProjectCount added in v0.0.6

func (a Account) GetProjectCount() *int

GetProjectCount implements the internal/types.Account interface

func (Account) GetUsername added in v0.0.6

func (a Account) GetUsername() *string

GetUsername implements the internal/types.Account interface

type AccountConfig added in v0.0.6

type AccountConfig struct {
	// Name is the user-defined label for this github account
	Name string `json:"name" yaml:"name,omitempty"`
	// Description is a user-defined description of what this account is for
	Description string `json:"description" yaml:"description,omitempty"`
	// AccessToken is the token that can be generated for use as a Personal Access Token,
	// this can be created at https://github.com/settings/tokens
	//
	// You'll need the following list of permissions when generating this:
	// - repo:status
	// - repo_deployment
	// - public_repo
	// - repo:invite
	// - read:packages
	// - read:org
	// - read:public_key
	// - read:repo_hook
	// - notifications
	// - read:user
	// - read:discussion
	// - read:enterprise
	// - read:gpg_key
	AccessToken string `json:"accessToken" yaml:"accessToken"`
	// Public indicates whether this account should be public, if so, the /platforms
	// endpoint on the dev server will expose this account; this is done to accomodate
	// using both personal and work accounts
	Public bool `json:"public" yaml:"public,omitempty"`
}

AccountConfig defines the structure of the configuration for a single logical Github account in the configuration

func (AccountConfig) GetSanitized added in v0.0.6

func (a AccountConfig) GetSanitized() AccountConfig

GetSanitized returns a copy of the current Account instance with sensitive credentials removed

type AccountConfigs added in v0.0.6

type AccountConfigs []AccountConfig

AccountConfigs defines a list of accounts that can be operated on

func (AccountConfigs) GetSanitized added in v0.0.6

func (a AccountConfigs) GetSanitized() AccountConfigs

GetSanitized returns a clone of the current Accounts instance without sensitive credentials

type Config

type Config struct {
	Accounts AccountConfigs `json:"accounts" yaml:"accounts,omitempty"`
}

Config defines the structure of the configuration for the github platform

func (Config) GetSanitized

func (c Config) GetSanitized() Config

GetSanitized returns a clone of the current Config instance without sensitive credentials

func (*Config) MergeWith added in v0.0.7

func (c *Config) MergeWith(o Config)

MergeWith merges the current Config instance with a provided Config instance. The merge strategy is add-only

type Notification added in v0.0.6

type Notification pkg.APIv3Notification

func (Notification) GetMessage added in v0.0.6

func (n Notification) GetMessage() string

func (Notification) GetTitle added in v0.0.6

func (n Notification) GetTitle() string

Jump to

Keyboard shortcuts

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