Documentation ¶
Index ¶
- func SetupLogin(c Core)
- func SetupNotepad(c Core)
- func SetupRegister(core Core)
- func SetupStatic(core Core)
- type Core
- type LoginEndpoint
- type NoteEndpoint
- func (p *NoteEndpoint) Create(w http.ResponseWriter, r *http.Request) (int, error)
- func (p NoteEndpoint) Destroy(w http.ResponseWriter, r *http.Request) (int, error)
- func (p NoteEndpoint) Index(w http.ResponseWriter, r *http.Request) (int, error)
- func (p NoteEndpoint) Show(w http.ResponseWriter, r *http.Request) (int, error)
- func (p *NoteEndpoint) Update(w http.ResponseWriter, r *http.Request) (int, error)
- type RegisterEndpoint
- type StaticEndpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Core ¶
type Core struct { Log logger.ILog Router *router.Mux Bind api.IBind Response api.IResponse Token api.IToken Password api.IPassword Store *store.Factory Context api.IContext }
Core represents the core for all the endpoints.
type LoginEndpoint ¶
type LoginEndpoint struct {
Core
}
LoginEndpoint .
func (*LoginEndpoint) Login ¶
func (p *LoginEndpoint) Login(w http.ResponseWriter, r *http.Request) (int, error)
Login . swagger:route POST /api/v1/login authentication UserLogin
Authenticate a user.
Responses:
200: LoginResponse 400: BadRequestResponse 500: InternalServerErrorResponse
type NoteEndpoint ¶
type NoteEndpoint struct {
Core
}
NoteEndpoint .
func (*NoteEndpoint) Create ¶
func (p *NoteEndpoint) Create(w http.ResponseWriter, r *http.Request) (int, error)
Create . swagger:route POST /api/v1/note note NoteCreate
Create a note.
Security:
token:
Responses:
201: CreatedResponse 400: BadRequestResponse 401: UnauthorizedResponse 500: InternalServerErrorResponse
func (NoteEndpoint) Destroy ¶
func (p NoteEndpoint) Destroy(w http.ResponseWriter, r *http.Request) (int, error)
Destroy . swagger:route DELETE /api/v1/note/{note_id} note NoteDestroy
Delete a note.
Security:
token:
Responses:
200: OKResponse 400: BadRequestResponse 401: UnauthorizedResponse 500: InternalServerErrorResponse
func (NoteEndpoint) Index ¶
func (p NoteEndpoint) Index(w http.ResponseWriter, r *http.Request) (int, error)
Index . swagger:route GET /api/v1/note note NoteIndex
List notes.
Security:
token:
Responses:
200: NoteIndexResponse 400: BadRequestResponse 401: UnauthorizedResponse 500: InternalServerErrorResponse
func (NoteEndpoint) Show ¶
func (p NoteEndpoint) Show(w http.ResponseWriter, r *http.Request) (int, error)
Show . swagger:route GET /api/v1/note/{note_id} note NoteShow
Show a note.
Security:
token:
Responses:
200: NoteShowResponse 400: BadRequestResponse 401: UnauthorizedResponse 500: InternalServerErrorResponse
func (*NoteEndpoint) Update ¶
func (p *NoteEndpoint) Update(w http.ResponseWriter, r *http.Request) (int, error)
Update . swagger:route PUT /api/v1/note/{note_id} note NoteUpdate
Update a note.
Security:
token:
Responses:
200: OKResponse 400: BadRequestResponse 401: UnauthorizedResponse 500: InternalServerErrorResponse
type RegisterEndpoint ¶
type RegisterEndpoint struct {
Core
}
RegisterEndpoint .
func (*RegisterEndpoint) Register ¶
func (p *RegisterEndpoint) Register(w http.ResponseWriter, r *http.Request) (int, error)
Register . swagger:route POST /api/v1/register authentication UserRegister
Register a user.
Responses:
201: CreatedResponse 400: BadRequestResponse 500: InternalServerErrorResponse
type StaticEndpoint ¶
type StaticEndpoint struct {
Core
}
StaticEndpoint .
func (StaticEndpoint) Index ¶
func (p StaticEndpoint) Index(w http.ResponseWriter, r *http.Request) (int, error)
Index . swagger:route GET /api/v1 healthcheck Ready
API is ready.
Responses:
200: OKResponse
func (StaticEndpoint) Static ¶
func (p StaticEndpoint) Static(w http.ResponseWriter, r *http.Request) (int, error)
Static .