Documentation ¶
Index ¶
- func GenerateToken(user_id int, timestamp string) (string, error)
- type CreateSessionCall
- type CreateSessionResponse
- type ExtendSessionCall
- type ExtendSessionResponse
- type GetSessionCall
- type GetSessionResponse
- type GetUserCall
- type GetUserResponse
- type MockPostgres
- func (m *MockPostgres) CreateSession(user_id int) (string, error)
- func (m *MockPostgres) ExtendSession(token string) error
- func (m *MockPostgres) GetSession(token string) (data.Session, error)
- func (m *MockPostgres) GetUser(username string, password string) (data.User, error)
- func (m *MockPostgres) SetCreateSessionResponse(response CreateSessionResponse)
- func (m *MockPostgres) SetExtendSessionResponse(response ExtendSessionResponse)
- func (m *MockPostgres) SetGetSessionResponse(response GetSessionResponse)
- func (m *MockPostgres) SetGetUserResponse(response GetUserResponse)
- func (m *MockPostgres) SetUpdateLastLoginResponse(response UpdateLastLoginResponse)
- func (m *MockPostgres) UpdateLastLogin(username string) error
- type Postgres
- func (p *Postgres) CreateSession(user_id int) (string, error)
- func (p *Postgres) ExtendSession(token string) error
- func (p *Postgres) GetSession(token string) (data.Session, error)
- func (p *Postgres) GetUser(username string, password string) (data.User, error)
- func (p *Postgres) UpdateLastLogin(username string) error
- type Postgreser
- type UpdateLastLoginCall
- type UpdateLastLoginResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateSessionCall ¶
type CreateSessionCall struct {
UserID int
}
type CreateSessionResponse ¶
type ExtendSessionCall ¶
type ExtendSessionCall struct {
Token string
}
type ExtendSessionResponse ¶
type ExtendSessionResponse struct {
Error error
}
type GetSessionCall ¶
type GetSessionCall struct {
Token string
}
type GetSessionResponse ¶
type GetUserCall ¶
type GetUserResponse ¶
type MockPostgres ¶
type MockPostgres struct { GetUserCalls []GetUserCall GetUserResponse GetUserResponse UpdateLastLoginCalls []UpdateLastLoginCall UpdateLastLoginResponse UpdateLastLoginResponse CreateSessionCalls []CreateSessionCall CreateSessionResponse CreateSessionResponse GetSessionCalls []GetSessionCall GetSessionResponse GetSessionResponse ExtendSessionCalls []ExtendSessionCall ExtendSessionResponse ExtendSessionResponse }
func InitMock ¶
func InitMock() MockPostgres
func (*MockPostgres) CreateSession ¶
func (m *MockPostgres) CreateSession(user_id int) (string, error)
func (*MockPostgres) ExtendSession ¶
func (m *MockPostgres) ExtendSession(token string) error
func (*MockPostgres) GetSession ¶
func (m *MockPostgres) GetSession(token string) (data.Session, error)
func (*MockPostgres) SetCreateSessionResponse ¶
func (m *MockPostgres) SetCreateSessionResponse(response CreateSessionResponse)
func (*MockPostgres) SetExtendSessionResponse ¶
func (m *MockPostgres) SetExtendSessionResponse(response ExtendSessionResponse)
func (*MockPostgres) SetGetSessionResponse ¶
func (m *MockPostgres) SetGetSessionResponse(response GetSessionResponse)
func (*MockPostgres) SetGetUserResponse ¶
func (m *MockPostgres) SetGetUserResponse(response GetUserResponse)
func (*MockPostgres) SetUpdateLastLoginResponse ¶
func (m *MockPostgres) SetUpdateLastLoginResponse( response UpdateLastLoginResponse, )
func (*MockPostgres) UpdateLastLogin ¶
func (m *MockPostgres) UpdateLastLogin(username string) error
type Postgres ¶
func ConfigInit ¶
func (*Postgres) ExtendSession ¶
func (*Postgres) UpdateLastLogin ¶
type Postgreser ¶
type UpdateLastLoginCall ¶
type UpdateLastLoginCall struct {
Username string
}
type UpdateLastLoginResponse ¶
type UpdateLastLoginResponse struct {
Error error
}
Click to show internal directories.
Click to hide internal directories.