api

package
v0.0.0-...-236d2f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

func New

func New(apiUrl string, apiKey string) *Api

func (*Api) CheckForUpdates

func (a *Api) CheckForUpdates() (updateRequired bool, getDat Data)

CheckForUpdates updates the Sqlite database if the timestamp has changed in the JSON message. It always updates on first run.

func (*Api) GetUsers

func (a *Api) GetUsers() (memberdata Data)

GetUsers Retreves and fills the Data structure of member data.

func (*Api) SendLoginAttempt

func (a *Api) SendLoginAttempt(key int, reason string, result string)

SendLoginAttempt sends the result of a login to the web api

type Data

type Data struct {
	Date    string   `json:"timestamp"`
	Members []Member `json:"members"`
}

type LoginAttempt

type LoginAttempt struct {
	Key       int    `json:"key"`
	Timestamp string `json:"timestamp"`
	Reason    string `json:"reason"`
	Result    string `json:"result"`
}

type Member

type Member struct {
	Id           float64 `json:"id"`
	Key          float64 `json:"key"`
	Hash         string  `json:"hash"`
	Irc_name     string  `json:"irc_name"`
	Spoken_name  string  `json:"spoken_name"`
	Added_by     float64 `json:"added_by"`
	Date_created string  `json:"date_created"`
	Last_login   string  `json:"last_login"`
	Admin        float64 `json:"admin"`
	Active       float64 `json:active`
	User_id      float64 `json:user_id`
	Created_at   string  `json:"created_at"`
	Updated_at   string  `json:"updated_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL