models

package
v0.0.0-...-90cdabe Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server struct {
		Host             string        `yaml:"host"`
		Port             string        `yaml:"port"`
		TimeoutInSeconds time.Duration `yaml:"timeout"`
	} `yaml:"server"`
	Database struct {
		Username string `envconfig:"MONGO_USERNAME"`
		Password string `envconfig:"MONGO_PASSWORD"`
		Host     string `yaml:"host", envconfig:"MONGO_HOST" env-default:"localhost"`
		Port     int    `yaml:"port", envconfig:"MONGO_PORT" env-default:"27017"`
	} `yaml:"database"`
	Crypto struct {
		JWTSecret string        `envconfig:"JWT_SECRET"`
		JWTIssuer string        `yaml:"issuer"`
		JWTExpire time.Duration `yaml:"tokenExpire"`
		SSLCert   string        `yaml:"SSLCert"`
		SSLKey    string        `yaml:"SSLKey"`
	} `yaml:"crypto"`
}

type Error

type Error struct {
	Message    string `json:"message"`
	StatusCode int    `json:"statusCode"`
}

type JWT

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

type User

type User struct {
	UserID   string `bson:"userId"   json:"userId"`
	Email    string `bson:"email"    json:"email"`
	Password string `bson:"password" json:"password"`
}

type UserResult

type UserResult struct {
	UserID string `bson:"userId"   json:"userId"`
	Email  string `bson:"email"    json:"email"`
}

Jump to

Keyboard shortcuts

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