Documentation ¶
Index ¶
- Variables
- type API
- type App
- type AppRepo
- func (r *AppRepo) Create(app *App) error
- func (r *AppRepo) Delete(name string) error
- func (r *AppRepo) Get(id string) (*App, error)
- func (r *AppRepo) GetByName(name string) (*App, error)
- func (r *AppRepo) List() ([]App, error)
- func (r *AppRepo) Update(id string, data map[string]interface{}) (*App, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrAppNameInvalid is the error returned when when trying to set invalid app name. ErrAppNameInvalid = errors.New("Name contains invalid characters. Alphanumeric only, no whitespace.") // ErrAppNotExist is the error returned when requested app ID or name doesn't exist. ErrAppNotExist = errors.New("App does not exist") // ErrAppNameTooLong is the error returned when trying to set too long app name. ErrAppNameTooLong = errors.New("App name too long. Max characters 30.") // AppNameMax is the maximum allowed length of an app name. AppNameMax = 30 )
Functions ¶
This section is empty.
Types ¶
type API ¶
API is an interface that binds together all parts of the host infrastructure.
func (*API) GetAppRepo ¶
GetAppRepo creates and returns a new AppRepo instance.
type App ¶
type App struct { ID string `db:"id"` Name string `db:"name"` CreatedAt *time.Time `db:"created_at"` UpdatedAt *time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
App represents the app in the database.
type AppRepo ¶
AppRepo handles all interfacing between the host API and database.
Click to show internal directories.
Click to hide internal directories.