Documentation ¶
Overview ¶
Package storage contains utilities for connecting to persistent storage as well as repository implementations for modifying/querying data used by the server.
Index ¶
- Variables
- func Open(name string) (*sql.DB, error)
- type Channels
- func (repo *Channels) Create(ctx context.Context, name string) error
- func (repo *Channels) Delete(ctx context.Context, name string) error
- func (repo *Channels) Exists(ctx context.Context, name string) (bool, error)
- func (repo *Channels) GetUserChannel(ctx context.Context, name string) (string, error)
- func (repo *Channels) Join(ctx context.Context, name, channel string) error
- func (repo *Channels) Leave(ctx context.Context, user, name string) error
- func (repo *Channels) List(ctx context.Context) ([]string, error)
- func (repo *Channels) Users(ctx context.Context, name string) ([]string, error)
- type Users
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUserNotInChannel is the error returned when performing operations specific // to a user within a channel where the user is not in that channel ErrUserNotInChannel = errors.New("user is not in any known channels") // ErrChannelDoesNotExist is the error returned when attempting to perform // operations on a channel that does not exist. ErrChannelDoesNotExist = errors.New("channel does not exist") )
var ErrNoUser = errors.New("user does not exist")
ErrNoUser is the error returned when performing operations on a user that does not exist.
Functions ¶
Types ¶
type Channels ¶
type Channels struct {
// contains filtered or unexported fields
}
The Channels type is responsible for querying/persisting channel information within the server storage.
func NewChannelRepository ¶
NewChannelRepository creates a new Channels instance that performs queries against the provided sql.DB instance.
func (*Channels) GetUserChannel ¶
GetUserChannel returns the channel a user currently resides in.
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
The Users type is responsible for querying/persisting user information within the server storage.
func NewUserRepository ¶
NewUserRepository creates a new Users instance that will perform operations against the provided sql.DB instance.
Directories ¶
Path | Synopsis |
---|---|
Package migrations contains code generated by go-bindata for performing database migrations.
|
Package migrations contains code generated by go-bindata for performing database migrations. |