Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresqlClient ¶
NewPostgresqlClient creates a new db client object
Types ¶
type DiskStore ¶
type DiskStore struct{}
DiskStore is a storage engine that writes to the disk
func (DiskStore) DeleteUser ¶
type PostgresqlStore ¶
type PostgresqlStore struct {
// contains filtered or unexported fields
}
PostgresqlStore is a storage engine that writes to postgres
func NewPostgresqlStore ¶
func NewPostgresqlStore(db *sql.DB) PostgresqlStore
NewPostgresqlStore creates new store
func (PostgresqlStore) DeleteUser ¶
func (s PostgresqlStore) DeleteUser(id string) bool
TODO: Not Implemented
func (PostgresqlStore) GetUser ¶
func (s PostgresqlStore) GetUser(id string) *User
GetUser will load a user from postgres
func (PostgresqlStore) Ping ¶
func (s PostgresqlStore) Ping(ctx context.Context) error
Ping will check if the connection works right
func (PostgresqlStore) WriteUser ¶
func (s PostgresqlStore) WriteUser(user User)
WriteUser will write a user object to postgres
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore is a storage engine that writes to redis
func NewRedisStore ¶
func NewRedisStore(client redis.Client) RedisStore
NewRedisStore creates new store
func (RedisStore) GetUser ¶
func (s RedisStore) GetUser(id string) *User
GetUser will load a user from redis
func (RedisStore) Ping ¶
func (s RedisStore) Ping(ctx context.Context) error
Ping will check if the connection works right
func (RedisStore) WriteUser ¶
func (s RedisStore) WriteUser(user User)
WriteUser will write a user object to redis
type Store ¶
type Store interface { WriteUser(user User) GetUser(id string) *User DeleteUser(id string) bool Ping(ctx context.Context) error }
Store is the interface for All the store types
Click to show internal directories.
Click to hide internal directories.