Versions in this module Expand all Collapse all v0 v0.1.3 May 14, 2023 Changes in this version + func NewContextWithAuthenticatedUser(ctx context.Context, user *User) context.Context type Server + ArchivePermissionApplicationService *archivePermissionApplicationService type SessionBasedAuthentication + UserRepository *UserRepository type User + func (u User) ByEmailResourceName() string v0.1.2 Apr 16, 2023 v0.1.1 Mar 31, 2023 v0.1.0 Mar 5, 2023 v0.0.3 Mar 5, 2023 v0.0.2 Mar 5, 2023 Changes in this version + func UserIDContext(ctx context.Context, userID int64) context.Context + type ArchiveService struct + func (service *ArchiveService) CreateArchive(ctx context.Context, owner string, name string) (dbArchive, error) + type AuthenticationController struct + UserRepository *UserRepository + func (c *AuthenticationController) RegisterRoutes(r chi.Router) + type Config struct + DataPath string + GRPC GRPCConfig + HTTP HTTPConfig + func (c Config) Listen() (ServerListeners, error) + type GRPCConfig struct + Enable bool + ListenOnAllInterfaces bool + Port uint16 + type HTTPConfig struct + Enable bool + ListenOnAllInterfaces bool + Port uint16 + PublicPath string + type PersonalAccessToken struct + ID int64 + Name string + Token string + TokenHash string + TokenLastEight string + TokenSalt string + UserID int64 + type PersonalAccessTokenRepository struct + func (r *PersonalAccessTokenRepository) CreatePersonalAccessToken(token PersonalAccessToken) (PersonalAccessToken, error) + func (r *PersonalAccessTokenRepository) FindPersonalAccessTokensByLastEight(tokenLastEight string) ([]PersonalAccessToken, error) + type Server struct + ArchiveApplicationService *archiveApplicationService + ArchiveService *ArchiveService + Config Config + HTTP struct{ ... } + PersonalAccessTokenApplicationService *personalAccessTokenApplicationService + PersonalAccessTokenRepository *PersonalAccessTokenRepository + SessionBasedAuthentication *SessionBasedAuthentication + UserRepository *UserRepository + UserService *UserService + func CreateServer(config Config) (*Server, error) + func (s *Server) ListenAndServe(ctx context.Context) error + func (s *Server) Serve(ctx context.Context, listeners ServerListeners) error + type ServerListeners struct + GRPC struct{ ... } + HTTP struct{ ... } + type Session struct + ID int64 + Token string + UserID int64 + type SessionBasedAuthentication struct + SessionRepository *SessionRepository + UserService *UserService + func (a *SessionBasedAuthentication) Middleware() func(http.Handler) http.Handler + func (a *SessionBasedAuthentication) RegisterRoutes(r chi.Router) + type SessionRepository struct + func (r *SessionRepository) Create(userID int64) (string, error) + func (r *SessionRepository) Delete(id int64) error + func (r *SessionRepository) GetSessionByToken(token string) (*Session, error) + type User struct + Email string + ID int64 + Password string + func (u User) ResourceName() string + type UserRepository struct + func (r *UserRepository) CreateUser(user User) (User, error) + func (r *UserRepository) GetUserByUserID(id int64) (*User, error) + func (r *UserRepository) GetUserByUserName(username string) (*User, error) + type UserService struct + func (s *UserService) CreateUser(emailAddress string, password string) (User, error) + func (s *UserService) VerifyLogin(context context.Context, username string, password string) (*User, error) v0.0.1-test Feb 25, 2023