Documentation ¶
Index ¶
Constants ¶
View Source
const (
CookieName = "gitserver-session"
)
Variables ¶
View Source
var ErrSessionCookieNotFound = errors.New("Session cookie not found")
View Source
var ErrUserNotFound = errors.New("User not found")
Functions ¶
func Setup ¶
func Setup(serveMux *http.ServeMux, config Config, userStore UserStore, ctxProvider ContextProvider, logger ContextAwareLogger)
Types ¶
type ContextAwareLogger ¶
type ContextAwareLogger interface { //Debug(ctx context.Context, message string) Debugf(ctx context.Context, format string, v ...interface{}) //Info(ctx context.Context, message string) Infof(ctx context.Context, format string, v ...interface{}) //Error(ctx context.Context, message string) Errorf(ctx context.Context, format string, v ...interface{}) }
type ContextProvider ¶
type GitTokenExtractor ¶
type GitTokenExtractor struct { }
type Login ¶
type Login struct {
// contains filtered or unexported fields
}
func NewLogin ¶
func NewLogin(userStore UserStore, config Config, ctxProvider ContextProvider, logger ContextAwareLogger, tokenExtractor TokenExtractor) *Login
func (*Login) LoginHandler ¶
func (l *Login) LoginHandler(res http.ResponseWriter, req *http.Request)
func (*Login) LogoutHandler ¶
func (l *Login) LogoutHandler(res http.ResponseWriter, req *http.Request)
type SessionCookie ¶
func SessionCookieFromCookie ¶
func SessionCookieFromCookie(cookie *http.Cookie) (SessionCookie, error)
type TokenExtractor ¶
type User ¶
type User struct { ID string Email string //There are some concerns here about thread safety Sessions []Session }
Perhaps this should be an interface instead?
type UserStoreErr ¶
type UserStoreErr struct {
Cause string
}
func NewUserStoreErr ¶
func NewUserStoreErr(cause string) UserStoreErr
func (UserStoreErr) Error ¶
func (err UserStoreErr) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.