models

package
v0.0.0-...-d304510 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadRequest will throw if the given request-body or params is not valid
	ErrBadRequest = errors.New("bad request")
	// ErrCannotBeDeleted will throw if the requested item can not be deleted
	ErrCannotBeDeleted = errors.New("cannot be deleted")
	// ErrConflict will throw if the current action already exists
	ErrConflict = errors.New("item already exists")
	// ErrDatabaseError will throw if any database error happen
	ErrDatabaseError = errors.New("database error")
	// ErrInternalServerError will throw if any the Internal Server Error happen
	ErrInternalServerError = errors.New("internal server error")
	// ErrNotFound will throw if the requested item does not exists
	ErrNotFound = errors.New("requested item is not found")
	// ErrTimeout will throw when the request timeout
	ErrTimeout = errors.New("timeout")
)

Functions

This section is empty.

Types

type ConfigStruct

type ConfigStruct struct {
	Claim     claimStruct            `yaml:"claim"`
	Database  databaseStruct         `yaml:"database"`
	Email     emailStruct            `yaml:"email"`
	Ethereum  []addressAndPrivateKey `yaml:"Ethereum"`
	JWT       string                 `yaml:"JWT"`
	NaCl      naclStruct             `yaml:"NaCl"`
	Port      int                    `yaml:"port"`
	Timeout   float64                `yaml:"timeout"`
	User      userStruct             `yaml:"user"`
	Websocket websocketStruct        `yaml:"websocket"`
}

ConfigStruct is the format of config/config.yml

type DIDAuthJWTPayload

type DIDAuthJWTPayload struct {
	DID       string
	Timestamp int
	UUID      string
}

DIDAuthJWTPayload is the format of a JWT payload

type Email

type Email struct {
	Email   string    `db:"email" validate:"required"`
	Code    string    `db:"code"`
	Valid   int64     `db:"valid"`
	Created time.Time `db:"created"`
	Updated time.Time `db:"updated"`
}

Email represents the email model

type Investor

type Investor struct {
	DID     string    `db:"did" validate:"required"`
	Claim   string    `db:"claim"`
	Status  string    `db:"status"`
	Created time.Time `db:"created"`
	Updated time.Time `db:"updated"`
}

Investor represents the investor model

type JWTHeader

type JWTHeader struct {
	Alg string
	Typ string
}

JWTHeader is the format of a JWT header

type KYCDBJWTPayload

type KYCDBJWTPayload struct {
	DID                    string
	Address                string
	Timestamp              int
	Resident               string
	Email                  string
	FirstName              string
	MiddleName             string
	LastName               string
	SocialSecurityNumber   string
	DateOfBirth            string
	ResidentialAddress     string
	InvestorType           int
	AccreditationCriterion int
	EvidenceType           int
	ApplicationDocuments   string
	Description            string
	RegisterDate           string
}

KYCDBJWTPayload is the format of a JWT payload for KYC

type ResponseWrapper

type ResponseWrapper struct {
	Result interface{}
	Status int
	Error  string
	Time   time.Time
}

ResponseWrapper is the format of a wrapper for API Response

type User

type User struct {
	FirstName string         `db:"firstname" validate:"required"`
	LastName  string         `db:"lastname" validate:"required"`
	Email     string         `db:"email" validate:"required"`
	Phone     string         `db:"phone" validate:"required"`
	Birthday  string         `db:"birthday" validate:"required"`
	SSN       sql.NullString `db:"ssn"`
	Country   sql.NullString `db:"country"`
	Region    sql.NullString `db:"region"`
	City      sql.NullString `db:"city"`
	Street    sql.NullString `db:"street"`
	Zip       int64          `db:"zip"`
	Passport  string         `db:"passport"`
	Address   sql.NullString `db:"address"`
	DID       sql.NullString `db:"did"`
	Created   time.Time      `db:"created"`
	Updated   time.Time      `db:"updated"`
}

User represents the user model

type WebSocketWrapper

type WebSocketWrapper struct {
	Data       interface{}
	Event      string
	ResultType int
}

WebSocketWrapper is the format of a wrapper for web socket

Jump to

Keyboard shortcuts

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