WebUser

package module
v0.0.0-...-850ad4a Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

README

WebUser

A simple library that acts as a user database to make example Web Applications. (Using JSON)

Install

go get github.com/NeutronX-dev/WebUser

Importing

import (
    "github.com/NeutronX-dev/WebUser"
)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash256

func Hash256(str string) string

func MakeToken

func MakeToken(username, password string) string

func RandomString

func RandomString(n int) string

Types

type UserList

type UserList struct {
	Path string
	Data []interface{}
}

func Read

func Read(path string) (*UserList, error)

func (*UserList) CreateUser

func (Users *UserList) CreateUser(username, password string) string

func (*UserList) CreateUserWithExtraColumns

func (Users *UserList) CreateUserWithExtraColumns(username, password string, extra_columns map[string]interface{}) string

func (*UserList) GetUserByToken

func (Users *UserList) GetUserByToken(token string) map[string]interface{}

func (*UserList) GetUserByUsername

func (Users *UserList) GetUserByUsername(username string) map[string]interface{}

func (*UserList) PasswordMatch

func (Users *UserList) PasswordMatch(username, decoded_password string) bool

func (*UserList) SaveData

func (Users *UserList) SaveData() error

func (*UserList) UserExists

func (Users *UserList) UserExists(username string) bool

Jump to

Keyboard shortcuts

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