Documentation
¶
Index ¶
- Variables
- type API
- func (a *API) DeleteUserConfiguration(w http.ResponseWriter, r *http.Request)
- func (a *API) DeleteUserInformation(w http.ResponseWriter, r *http.Request)
- func (a *API) GetImage(w http.ResponseWriter, r *http.Request)
- func (a *API) GetItems() ([]model.Item, error)
- func (a *API) GetItemsAll(w http.ResponseWriter, r *http.Request)
- func (a *API) GetItemsBack(w http.ResponseWriter, r *http.Request)
- func (a *API) GetItemsFront(w http.ResponseWriter, r *http.Request)
- func (a *API) GetOrderHistory(w http.ResponseWriter, r *http.Request)
- func (a *API) GetUserConfiguration(w http.ResponseWriter, r *http.Request)
- func (a *API) GetUserInformation(w http.ResponseWriter, r *http.Request)
- func (a *API) Login(w http.ResponseWriter, r *http.Request)
- func (a *API) RefreshToken(w http.ResponseWriter, r *http.Request)
- func (a *API) SignUp(w http.ResponseWriter, r *http.Request)
- func (a *API) StoreUserConfiguration(w http.ResponseWriter, r *http.Request)
- func (a *API) StoreUserInformation(w http.ResponseWriter, r *http.Request)
- func (a *API) UpdateUserConfiguration(w http.ResponseWriter, r *http.Request)
- func (a *API) UpdateUserInformation(w http.ResponseWriter, r *http.Request)
- type Config
- type ContextKey
- type Payload
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidToken = errors.New("token is invalid") ErrExpiredToken = errors.New("token has expired") )
Functions ¶
This section is empty.
Types ¶
type API ¶
structure of the API
func New ¶
func New(config *Config, svc service.Service, router *mux.Router, errors model.ErrorJson) (*API, error)
New returns the api settings
func (*API) DeleteUserConfiguration ¶
func (a *API) DeleteUserConfiguration(w http.ResponseWriter, r *http.Request)
endpoint for get user configuration
func (*API) DeleteUserInformation ¶
func (a *API) DeleteUserInformation(w http.ResponseWriter, r *http.Request)
endpoint for delete userInformation
func (*API) GetImage ¶
func (a *API) GetImage(w http.ResponseWriter, r *http.Request)
endpoint for store userInformation
func (*API) GetItemsAll ¶
func (a *API) GetItemsAll(w http.ResponseWriter, r *http.Request)
Endpoint for all Item enums
func (*API) GetItemsBack ¶
func (a *API) GetItemsBack(w http.ResponseWriter, r *http.Request)
Endpoint for back Item enums
func (*API) GetItemsFront ¶
func (a *API) GetItemsFront(w http.ResponseWriter, r *http.Request)
Endpoint for Front Item enums
func (*API) GetOrderHistory ¶
func (a *API) GetOrderHistory(w http.ResponseWriter, r *http.Request)
func (*API) GetUserConfiguration ¶
func (a *API) GetUserConfiguration(w http.ResponseWriter, r *http.Request)
endpoint for get user configuration
func (*API) GetUserInformation ¶
func (a *API) GetUserInformation(w http.ResponseWriter, r *http.Request)
endpoint for get userInformation
func (*API) Login ¶
func (a *API) Login(w http.ResponseWriter, r *http.Request)
Login endpoints responsible from user login
func (*API) RefreshToken ¶
func (a *API) RefreshToken(w http.ResponseWriter, r *http.Request)
Login endpoints responsible from user login
func (*API) SignUp ¶
func (a *API) SignUp(w http.ResponseWriter, r *http.Request)
Register endpoints responsible from user register
func (*API) StoreUserConfiguration ¶
func (a *API) StoreUserConfiguration(w http.ResponseWriter, r *http.Request)
endpoint for store user configuration
func (*API) StoreUserInformation ¶
func (a *API) StoreUserInformation(w http.ResponseWriter, r *http.Request)
endpoint for store userInformation
func (*API) UpdateUserConfiguration ¶
func (a *API) UpdateUserConfiguration(w http.ResponseWriter, r *http.Request)
endpoint for update user configuration
func (*API) UpdateUserInformation ¶
func (a *API) UpdateUserInformation(w http.ResponseWriter, r *http.Request)
endpoint for update userInformation
type Config ¶
type Config struct { Domain string `yaml:"domain"` SigningSecret string `yaml:"signing_secret"` ImagePath string `yaml:"imagePath"` Enums struct { Front []map[string]string `yaml:"front"` Back []map[string]string `yaml:"back"` } `yaml:"enum"` PythonBackendAddress string `yaml:"python_backend_address"` FakeApiAddress string `yaml:"fake_api_address"` }
API configuration
type ContextKey ¶
type ContextKey string
ContextKey implements type for context key
const ContextJWTKey ContextKey = "jwt"
ContextJWTKey is the key for the jwt context value