Documentation ¶
Index ¶
- func AddIntent(locale string, intent analysis.Intent)
- func Authenticate()
- func AuthenticationFileExists() bool
- func ChecksToken(token string) bool
- func CreateIntent(w http.ResponseWriter, r *http.Request)
- func DeleteIntent(w http.ResponseWriter, r *http.Request)
- func GenerateToken() string
- func GetIntents(w http.ResponseWriter, r *http.Request)
- func HashToken(token string) []byte
- func RemoveIntent(locale, tag string)
- func SaveHash(hash string)
- func WriteIntents(locale string, intents []analysis.Intent)
- type DeleteRequest
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func Authenticate()
Authenticate checks if the authentication file exists and if not it generates the file with a new token
func AuthenticationFileExists ¶
func AuthenticationFileExists() bool
AuthenticationFileExists checks if the authentication file exists and return the condition
func ChecksToken ¶
ChecksToken checks if the given token is the good one from the authentication file
func CreateIntent ¶
func CreateIntent(w http.ResponseWriter, r *http.Request)
CreateIntent is the route to create a new intent
func DeleteIntent ¶
func DeleteIntent(w http.ResponseWriter, r *http.Request)
DeleteIntent is the route used to delete an intent
func GenerateToken ¶
func GenerateToken() string
GenerateToken generates a random token of 30 characters and returns it
func GetIntents ¶
func GetIntents(w http.ResponseWriter, r *http.Request)
GetIntents is the route to get the intents
func RemoveIntent ¶
func RemoveIntent(locale, tag string)
RemoveIntent removes the intent with the given tag from the intents file
func WriteIntents ¶
WriteIntents writes the given intents to the intents file
Types ¶
type DeleteRequest ¶
type DeleteRequest struct {
Tag string `json:"tag"`
}
DeleteRequest is for the parameters required to delete an intent via the REST Api