GithubConn holds the essential information to connect to the GitHub API
| 52 | |
| 53 | // GithubConn holds the essential information to connect to the GitHub API |
| 54 | type GithubConn struct { |
| 55 | helper.RestConnection `mapstructure:",squash"` |
| 56 | helper.MultiAuth `mapstructure:",squash"` |
| 57 | GithubAccessToken `mapstructure:",squash" authMethod:"AccessToken"` |
| 58 | GithubAppKey `mapstructure:",squash" authMethod:"AppKey"` |
| 59 | RefreshToken string `mapstructure:"refreshToken" json:"refreshToken" gorm:"type:text;serializer:encdec"` |
| 60 | TokenExpiresAt *time.Time `mapstructure:"tokenExpiresAt" json:"tokenExpiresAt"` |
| 61 | RefreshTokenExpiresAt *time.Time `mapstructure:"refreshTokenExpiresAt" json:"refreshTokenExpiresAt"` |
| 62 | } |
| 63 | |
| 64 | // UpdateToken updates the token and refresh token information |
| 65 | func (conn *GithubConn) UpdateToken(newToken, newRefreshToken string, expiry, refreshExpiry *time.Time) { |
nothing calls this directly
no outgoing calls
no test coverage detected