Documentation ¶
Overview ¶
Package api gomithrilapp API
This is the API for the sample notepad application in Mithril and Go.
Swagger 2.0 Spec - generated by [go-swagger](https://github.com/go-swagger/go-swagger)
Schemes: http Host: localhost:8080 BasePath: / Version: 1.0
Consumes: - application/json
Produces: - application/json
SecurityDefinitions: token:
type: apiKey name: Authorization in: header description: "In the 'Value' textbox below, please enter in the word 'Bearer', a space, and then paste in your token."
swagger:meta
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IContext ¶
type IContext interface { SetUserID(r *http.Request, val string) UserID(r *http.Request) (string, bool) }
IContext provides handlers for type request context.
type IDatabase ¶
type IDatabase interface { Exec(query string, args ...interface{}) (sql.Result, error) Get(dest interface{}, query string, args ...interface{}) error Select(dest interface{}, query string, args ...interface{}) error QueryRowScan(dest interface{}, query string, args ...interface{}) error Name() string RecordExists(err error) (bool, error) AffectedRows(result sql.Result) int RecordExistsString(err error, s string) (bool, string, error) SuppressNoRowsError(err error) error }
IDatabase provides data query capabilities.
type IPassword ¶
type IPassword interface { Hash(password string) (string, error) Match(hash, password string) bool }
IPassword provides password hashing.
type IQuery ¶
type IQuery interface { FindOneByID(dest IRecord, ID string) (found bool, err error) FindOneByField(dest IRecord, field string, value string) (exists bool, err error) FindAll(dest IRecord) (total int, err error) ExistsByID(db IRecord, s string) (found bool, err error) ExistsByField(db IRecord, field string, value string) (found bool, ID string, err error) DeleteOneByID(dest IRecord, ID string) (affected int, err error) DeleteAll(dest IRecord) (affected int, err error) }
IQuery provides default queries.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
pkg
|
|
env
Package env will fill a struct from environment variables.
|
Package env will fill a struct from environment variables. |
logger
Package logger standardizes the logging functions available to your team.
|
Package logger standardizes the logging functions available to your team. |
mock
Package mock allows you to return specific values for functions.
|
Package mock allows you to return specific values for functions. |
passhash
Package passhash provides password hashing functionality using bcrypt.
|
Package passhash provides password hashing functionality using bcrypt. |
Click to show internal directories.
Click to hide internal directories.