Documentation
¶
Index ¶
- func GetAccount(client request.Doer, accessToken string) (types.Account, error)
- func GetNotifications(client request.Doer, accessToken string, since ...time.Time) (types.Notifications, error)
- type Account
- func (a Account) GetCreatedAt() *string
- func (a Account) GetEmail() *string
- func (a Account) GetFollowerCount() *int
- func (a Account) GetIsAdmin() *bool
- func (a Account) GetLastSeen() *string
- func (a Account) GetLink() *string
- func (a Account) GetName() *string
- func (a Account) GetProjectCount() *int
- func (a Account) GetUsername() *string
- type AccountConfig
- type AccountConfigs
- type Config
- type Notification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccount ¶
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
GetCreatedAt implements the internal/types.Account interface
func (Account) GetFollowerCount ¶ added in v0.0.6
GetFollowerCount implements the internal/types.Account interface
func (Account) GetIsAdmin ¶ added in v0.0.6
GetIsAdmin implements the internal/types.Account interface
func (Account) GetLastSeen ¶ added in v0.0.6
GetLastSeen implements the internal/types.Account interface
func (Account) GetProjectCount ¶ added in v0.0.6
GetProjectCount implements the internal/types.Account interface
func (Account) GetUsername ¶ added in v0.0.6
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 ¶
GetSanitized returns a clone of the current Config instance without sensitive credentials
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