app

package
v0.0.0-...-50bf917 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BasePath is the path to the project
	BasePath = os.Getenv("GOPATH") + "/src/github.com/kiketordera/pilar-web"
)

Functions

This section is empty.

Types

type Case

type Case struct {
	ID     bson.ObjectId `json:"id"`
	UserID bson.ObjectId `json:"userid"`
	Name   string        `json:"name" form:"name" binding:"required"`
	Docs   []string      `json:"docs"`
	// This is the case used by the lawyer in his excels
	InternalID string `json:"ref" form:"ref" binding:"required"`
	// If stateCompleted true, the case is closed
	StateCompleted bool   `json:"statecompleted"`
	Hitos          []Hito `json:"hitos"`
	// Used for the HTML
	NameUser string `json:"nameuser"`
}

User is the user of the system

type DB

type DB struct {
	DataBase *bolthold.Store
}

DB is the DataBase which contains the information.

func InitDatabase

func InitDatabase() DB

InitDatabase returns the DataBase of the project or creates a new DataBase if does not exists

func (*DB) Start

func (db *DB) Start(wg *sync.WaitGroup)

Start the web server for a Server object

type Date

type Date struct {
	ID              bson.ObjectId `json:"id"`
	CaseID          bson.ObjectId `json:"caseid"`
	Date            time.Time     `json:"dates"`
	PlaceFirstLine  string        `json:"place1" form:"juzgadoplace"`
	PlaceSecondLine string        `json:"place1" form:"juzgadonumber"`
	Pueblo          string        `json:"pueblo" form:"pueblo"`
	Provincia       string        `json:"provincia" form:"provincia"`
}

type Hito

type Hito struct {
	Name  string `json:"name"`
	State bool   `json:"state"`
}

type Role

type Role string

Role is the close list of different roles that the users can have

const (
	Admin    Role = "admin"
	Customer Role = "customer"
)

The options for RoleType

type TokenClaims

type TokenClaims struct {
	Username string `json:"usr,omitempty"`
	Role     string `json:"rol,omitempty"`
	jwt.StandardClaims
}

TokenClaims is the token that we store in the cookies

type User

type User struct {
	ID       bson.ObjectId `json:"id"`
	Name     string        `json:"name" form:"name" binding:"required"`
	Surname  string        `json:"surname" form:"surname" binding:"required"`
	Email    string        `json:"email" form:"email" binding:"required"`
	Phone    int           `json:"email" form:"phone" binding:"required"`
	Password string        `json:"password" form:"password"`
	Role     Role          `json:"role" form:"role"`
}

User is the user of the system

Jump to

Keyboard shortcuts

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