DB

package
v0.0.0-...-7354276 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const BlackListCollection = "BlackList"
View Source
const CSVpath = "Files/CSV"
View Source
const ContractCollection = "Contract"
View Source
const ContractFolderCollection = "ContractFolder"
View Source
const ContractHtmlCol = "ContractHtml"
View Source
const Contractfilepath = "Files/Contracts"
View Source
const CoordinatesCol = "Coordinates"
View Source
const Def_pic_path = "Files/Profile_pics/default.jpeg"
View Source
const FolderCollection = "Folder"
View Source
const InitialsPath = "Files/User_signs/Initials"
View Source
const MaxContractSize = 10 * 1024 * 1024
View Source
const MaxpicSize = 5 * 1024 * 1024
View Source
const Profilepicspath = "Files/Profile_pics"
View Source
const RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
View Source
const SignerCollection = "Signer"
View Source
const Signpath = "Files/User_signs/Signs"
View Source
const UserCollection = "Users"
View Source
const VerifCollection = "Verification"
View Source
const WalletsCollection = "Wallets"

Variables

View Source
var AllCoordinates []PlaygroundInput
View Source
var MySigningKey = []byte("secretkey")

Functions

func ContractManipulation

func ContractManipulation(contractpath string, signpath string, top int, left int) bool

func CredentialValidation

func CredentialValidation(usr User) (bool, string)

func Dbinit

func Dbinit(settings mysql.ConnectionURL) (*dbServer, error)

Dbinit : creates data base connection and returns database object

func DownloadFile

func DownloadFile(writer http.ResponseWriter, request *http.Request)

func GenerateToken

func GenerateToken(len int) string

func GetClaims

func GetClaims(tokenstring string) (jwt.MapClaims, bool)

func Logger

func Logger(logstring string)

func RenderError

func RenderError(w http.ResponseWriter, message string)

RenderError : creates error response

func RenderResponse

func RenderResponse(w http.ResponseWriter, message string, statusCode int)

RenderResponse : creates response

func Save

func Save(data string, path string)

func VerifyEmail

func VerifyEmail(mail string) (bool, string)

func VerifyPassword

func VerifyPassword(password string) (bool, string)

Types

type Base64

type Base64 struct {
	SignBase64     string
	InitialsBase64 string
}

type BlackList

type BlackList struct {
	TokenString string `db:"token"`
	ExpTime     string `db:"exptime"`
}

type Contract

type Contract struct {
	ContractID           string `db:"ContractID"`
	Filepath             string `db:"filepath"`
	Status               string `db:"status"`
	ContractcreationTime string `db:"creationTime"`
	Creator              string `db:"Creator"`
	DelStatus            int    `db:"delStatus"`
	UpdateTime           string `db:"updateTime"`
	ContractName         string `db:"contractName"`
	ExpirationTime       string `db:"ExpirationTime"`
	Blockchain           int    `db:"Blockchain"`
	Message              string `db:"Message"`
}

func TimeSearch

func TimeSearch(Allcontracts []Contract, timeframe string) []Contract

type ContractBasic

type ContractBasic struct {
	ContractID string
	Path       string
}

type ContractDetail

type ContractDetail struct {
	ContractData Contract
	Signers      []Signer
}

type ContractDetailHash

type ContractDetailHash struct {
	ContractData Contract
	Signers      []Signer
	ContractHash string
}

type ContractFolder

type ContractFolder struct {
	FolderID   string `db:"folderID"`
	ContractID string `db:"ContractID"`
}

type Coordinates

type Coordinates struct {
	ContractID string `db:"ContractID"`
	UserID     string `db: "userID"`
	Name       string `db:"name"`
	Topcord    int    `db: "topcord"`
	Leftcord   int    `db:"leftcord"`
}

type EmailVerf

type EmailVerf struct {
	Email            string `json:"email"`
	VerificationCode string `json:"VerificationCode"`
}

type Exception

type Exception struct {
	Message string `json:"message"`
}

type Folder

type Folder struct {
	FolderID     string `db:"folderID"`
	FolderName   string `db:"folderName"`
	FolderType   string `db:"folderType"`
	UserID       string `db:"userID"`
	ParentFolder string `db:"parentFolder"`
}

type JwtToken

type JwtToken struct {
	Token string `json:"token"`
}

type LogCheck

type LogCheck struct {
	Email    string `json:"email"`
	Password string `json:password`
}

type LoginStruct

type LoginStruct struct {
	Userdata     User
	WaitingME    uint64
	WaitingOther uint64
	ExpiringSoon int
	Token        string
}

type ManageScreen

type ManageScreen struct {
	InboxContracts []Contract
	FolderList     []Folder
}

type Passrecovery

type Passrecovery struct {
	Email string `json:"email"`
	Vcode string `json:"vcode"`
	Pass  string `json:"password"`
}

type PlaygroundInput

type PlaygroundInput struct {
	Contractid string `json:"contractid"`
	Top        int    `json :"top"`
	Left       int    `json :"left"`
	Recipient  string `json :"recipient"`
	Text       string `json: "text"`
}

type Preferences

type Preferences struct {
	UserName string `json:"username"`
	Company  string `json:"company"`
	Phone    string `json:"phone"`
}

type SaveWalletinput

type SaveWalletinput struct {
	ContractID    string `json: "ContractID"`
	UserID        string `json:"userid"`
	PublicAddress string `json:"publicAddress"`
}

type SearchInput

type SearchInput struct {
	ContractName string `json:"ContractName"`
	Status       string `json:"Status"`
	Date         string `json:"Date"`
}

type SendContract

type SendContract struct {
	ContractID string `json:"ContractID"`
	EmailSubj  string `json:"EmailSubj"`
	EmailMsg   string `json:"EmailMsg"`
}

type SignContract

type SignContract struct {
	FileBase64 string `json: "FileBase64"`
	ContractID string `json: "ContractID"`
}

type SignRes

type SignRes struct {
	Signpath     string
	InitialsPath string
}

type Signer

type Signer struct {
	ContractID    string `db:"ContractID"`
	UserID        string `db:"userID"`
	Name          string `db:"name"`
	SignStatus    string `db:"SignStatus"`
	SignDate      string `db:"SignDate"`
	DeleteApprove int    `db:"DeleteApprove"`
	Message       string `db:"Message"`
	Access        int    `db:"Access"`
	CC            int    `db:"CC"`
}

type Signerdata

type Signerdata struct {
	ContractID  string `json:"cid"`
	Email       string `json:"email"`
	Name        string `json:"name"`
	NeedtoSign  bool   `json:"NeedtoSign"`
	ReceiveCopy bool   `json:"Receiveacopy"`
}

type Testing

type Testing struct {
	ContractID string `db:"ContractID"`
	UserID     string `db:"userID"`
	Name       string `db:"name"`
	Topcord    string `db: "topcord"`
	Leftcord   string `db: "leftcord"`
}

type User

type User struct {
	Userid       string `db:"userid"`
	Email        string `db:"email"`
	Password     string `db:"password"`
	Name         string `db:"name"`
	Company      string `db:"company"`
	Phone        string `db:"phone"`
	Picture      string `db:"picture"`
	Sign         string `db:"sign"`
	Initials     string `db:"initials"`
	Verified     int    `db:"verified"`
	CreationTime string `db:"creationTime"`
}

type VerifUser

type VerifUser struct {
	UserID           string `db:"userid"`
	VerificationCode string `db:"VerificationCode"`
	ExpTime          string `db:"exptime"`
}

type WalletInfo

type WalletInfo struct {
	Userid        string `db:"userid"`
	PublicAddress string `db: "walletaddress"`
}

Jump to

Keyboard shortcuts

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