api

package
Version: v0.0.0-...-1a912f8 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

README

API

  • User

    • /enter = {login:string, pass:string} => {result:string, token:string}

    • /testToken = {token:string} = > {result:string}

    • /create = {login:string, pass:string} => {result:string, token:string}

    • /getMyChats = {token:string} => {[...{ }]}

    • /myData = {login:string, pass:string} => {id: int64}

    • /getSettings = {login:string, pass:string} => {login:string, name:string}

    • /setSettings = {login:string, pass:string} => {name:string}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetOnlineUsers - external function in 'messages'  for getting online users count
	GetOnlineUsers onlineUsers
)

Functions

func RegisterEndpoints

func RegisterEndpoints(r *Router)

RegisterEndpoints - registr endpoints

func TestUserToken

func TestUserToken(token string) (*db.User, error)

func UserByCookie

func UserByCookie(r *http.Request) (*db.User, error)

func UserByHeader

func UserByHeader(r *http.Request) (*db.User, error)

Types

type Router

type Router struct {
	Route    func(pattern string, handler func(w http.ResponseWriter, r *http.Request), methods ...string)
	Subroute func(pattern string) *Router
}

Jump to

Keyboard shortcuts

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