olivia: github.com/olivia-ai/olivia/user Index | Files

package user

import "github.com/olivia-ai/olivia/user"


Package Files


func ChangeUserInformation Uses

func ChangeUserInformation(token string, changer func(Information) Information)

ChangeUserInformation requires the token of the user and a function which gives the actual information and returns the new information.

func SetUserInformation Uses

func SetUserInformation(token string, information Information)

SetUserInformation sets the user's information by its token.

type Information Uses

type Information struct {
    Name           string        `json:"name"`
    MovieGenres    []string      `json:"movie_genres"`
    MovieBlacklist []string      `json:"movie_blacklist"`
    Reminders      []Reminder    `json:"reminders"`
    SpotifyToken   *oauth2.Token `json:"spotify_token"`
    SpotifyID      string        `json:"spotify_id"`
    SpotifySecret  string        `json:"spotify_secret"`

Information is the user's information retrieved from the client

func GetUserInformation Uses

func GetUserInformation(token string) Information

GetUserInformation returns the information of a user with his token

type Reminder Uses

type Reminder struct {
    Reason string `json:"reason"`
    Date   string `json:"date"`

A Reminder is something the user asked for Olivia to remember

Package user imports 1 packages (graph) and is imported by 5 packages. Updated 2020-04-24. Refresh now. Tools for package owners.