Documentation ¶
Index ¶
- func NewMinioClient(conf MinioConf) (client *minio.Client, err error)
- func NewPostgreSQL(conf DBConf) (db *gorm.DB, err error)
- type Admin
- type Conf
- type DBConf
- type MinioConf
- type Record
- type Server
- func (s *Server) CreateAccount(w http.ResponseWriter, r *http.Request)
- func (s *Server) CreateTables(values ...interface{}) (err error)
- func (s *Server) CreateUser(username string, password string, role m.UserRole) (err error)
- func (s *Server) DeleteAccount(w http.ResponseWriter, r *http.Request)
- func (s *Server) DropTables(values ...interface{}) (err error)
- func (s *Server) FetchAccounts(w http.ResponseWriter, r *http.Request)
- func (s *Server) FetchRecord(w http.ResponseWriter, r *http.Request)
- func (s *Server) Free()
- func (s *Server) Login(w http.ResponseWriter, r *http.Request)
- func (s *Server) Logout(w http.ResponseWriter, r *http.Request)
- func (s *Server) MinioUpload(fp string, objName string, contentType string) (err error)
- func (s *Server) ResetTables(values ...interface{}) (err error)
- func (s *Server) StartOrDie() (err error)
- func (s *Server) UpdateAccount(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMinioClient ¶
NewMinioClient ...
Types ¶
type Conf ¶
type Conf struct { DB DBConf `yaml:"db"` CROSAllowOrigins []string `yaml:"cros_allow_origins"` StorageDir string `yaml:"storage_dir"` Web struct { Port int `yaml:"port"` // Timeout config WriteTimeoutInSec time.Duration `yaml:"write_timeout_sec"` ReadTimeoutInSec time.Duration `yaml:"read_timeout_sec"` ReadHeaderTimeout time.Duration `yaml:"read_header_timeout_sec"` IdleTimeoutInSec time.Duration `yaml:"idle_timeout_sec"` ShutdownWaitInSec time.Duration `yaml:"shutdown_wait_sec"` } `yaml:"web"` CreateAdmin bool `yaml:"create_admin"` Admin Admin `yaml:"admin"` Record Record `yaml:"record"` Minio MinioConf `yaml:"minio"` }
Conf ...
type DBConf ¶
type DBConf struct { Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` Port int `yaml:"port"` Host string `yaml:"host"` Reset bool `yaml:"reset"` ReconnectSec time.Duration `yaml:"reconnect_sec"` }
DBConf ...
type MinioConf ¶
type MinioConf struct { AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` EndPoint string `yaml:"endpoint"` Secure bool `yaml:"secure"` }
MinioConf ...
type Server ¶
type Server struct { HTTPHandler http.Handler Frontend *packr.Box Conf Conf DB *gorm.DB Minio *minio.Client }
Server ...
func (*Server) CreateAccount ¶
func (s *Server) CreateAccount(w http.ResponseWriter, r *http.Request)
CreateAccount ...
func (*Server) CreateTables ¶
CreateTables create all tables
func (*Server) CreateUser ¶
CreateUser ...
func (*Server) DeleteAccount ¶
func (s *Server) DeleteAccount(w http.ResponseWriter, r *http.Request)
DeleteAccount ...
func (*Server) DropTables ¶
DropTables drop all tables
func (*Server) FetchAccounts ¶
func (s *Server) FetchAccounts(w http.ResponseWriter, r *http.Request)
FetchAccounts ...
func (*Server) FetchRecord ¶
func (s *Server) FetchRecord(w http.ResponseWriter, r *http.Request)
FetchRecord ...
func (*Server) MinioUpload ¶
MinioUpload ...
func (*Server) ResetTables ¶
ResetTables drop and create tables
func (*Server) UpdateAccount ¶
func (s *Server) UpdateAccount(w http.ResponseWriter, r *http.Request)
UpdateAccount ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.