Documentation ¶
Index ¶
- type Config
- type Instance
- type MockInstance
- func (_m *MockInstance) GetName() string
- func (_m *MockInstance) GetOrganization() string
- func (_m *MockInstance) OAuthCallback(ctx context.Context, state string, code string) (*oauth2.Token, *github.User, error)
- func (_m *MockInstance) OAuthIsAuthenticated(ctx context.Context, token *oauth2.Token) (*github.User, error)
- func (_m *MockInstance) OAuthLoginURL() string
- func (_m *MockInstance) TokenFromCookie(r *http.Request) (*oauth2.Token, error)
- func (_m *MockInstance) TokenToCookie(token *oauth2.Token) (*http.Cookie, error)
- type NewMockInstanceT
- type OAuthConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Organization string `json:"organization"` OAuth OAuthConfig `json:"oauth"` Session auth.SessionConfig `json:"session"` }
Config is the structure of the configuration for a single GitHub instance.
type Instance ¶
type Instance interface { GetName() string GetOrganization() string TokenToCookie(token *oauth2.Token) (*http.Cookie, error) TokenFromCookie(r *http.Request) (*oauth2.Token, error) OAuthLoginURL() string OAuthCallback(ctx context.Context, state, code string) (*oauth2.Token, *github.User, error) OAuthIsAuthenticated(ctx context.Context, token *oauth2.Token) (*github.User, error) }
type MockInstance ¶
MockInstance is an autogenerated mock type for the Instance type
func NewMockInstance ¶
func NewMockInstance(t NewMockInstanceT) *MockInstance
NewMockInstance creates a new instance of MockInstance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInstance) GetName ¶
func (_m *MockInstance) GetName() string
GetName provides a mock function with given fields:
func (*MockInstance) GetOrganization ¶
func (_m *MockInstance) GetOrganization() string
GetOrganization provides a mock function with given fields:
func (*MockInstance) OAuthCallback ¶
func (_m *MockInstance) OAuthCallback(ctx context.Context, state string, code string) (*oauth2.Token, *github.User, error)
OAuthCallback provides a mock function with given fields: ctx, state, code
func (*MockInstance) OAuthIsAuthenticated ¶
func (_m *MockInstance) OAuthIsAuthenticated(ctx context.Context, token *oauth2.Token) (*github.User, error)
OAuthIsAuthenticated provides a mock function with given fields: ctx, token
func (*MockInstance) OAuthLoginURL ¶
func (_m *MockInstance) OAuthLoginURL() string
OAuthLoginURL provides a mock function with given fields:
func (*MockInstance) TokenFromCookie ¶
TokenFromCookie provides a mock function with given fields: r
func (*MockInstance) TokenToCookie ¶
TokenToCookie provides a mock function with given fields: token