Documentation ¶
Index ¶
- Variables
- func GenerateOTP(length int) (string, error)
- type FileHiveServer
- type Option
- func Domain(domain string) Option
- func FilecoinAddress(filecoinAddress string) Option
- func JWTKey(key []byte) Option
- func MailDomain(mailDomain string) Option
- func MailgunKey(mailgunKey string) Option
- func SSLCert(sslCert string) Option
- func SSLKey(sslKey string) Option
- func TestMode(testMode bool) Option
- func UseSSL(useSSL bool) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrUserExists = errors.New("user already exists") ErrBadPassword = errors.New("password is too short") ErrWeakPassword = errors.New("password is too weak") ErrIncorrectPassword = errors.New("password is incorrect") ErrInvalidEmail = errors.New("email address is invalid") ErrInvalidJSON = errors.New("invalid JSON input") ErrUserNotFound = errors.New("user not found") ErrUserNotResetting = errors.New("password token and email combo not valid") ErrDatasetNotFound = errors.New("dataset not found") ErrNotLoggedIn = errors.New("not logged in") ErrInvalidImage = errors.New("invalid base64 image") ErrInvalidAddress = errors.New("invalid address") ErrImageNotFound = errors.New("image not found") ErrInvalidOption = errors.New("invalid option") ErrMissingForm = errors.New("missing form") ErrInsuffientFunds = errors.New("insufficient funds") )
Functions ¶
func GenerateOTP ¶
Types ¶
type FileHiveServer ¶
type FileHiveServer struct {
// contains filtered or unexported fields
}
FileHiveServer is the web server used to serve the FileHive application.
func NewServer ¶
func NewServer(listener net.Listener, db *repo.Database, staticFileDir string, walletBackend fil.WalletBackend, filecoinBackend fil.FilecoinBackend, opts ...Option) (*FileHiveServer, error)
NewServer instantiates a new FileHiveServer with the provided options.
func (*FileHiveServer) Close ¶
func (s *FileHiveServer) Close() error
Close shutsdown the Gateway listener.
func (*FileHiveServer) Serve ¶
func (s *FileHiveServer) Serve() error
Serve begins listening on the configured address.
type Option ¶
Option represents a db option.
func Domain ¶
Domain sets the domain the server is running on. Defaults to the current domain of the request only (recommended).
This should be a hostname and not a URL. If set, the domain is treated as being prefixed with a '.' - e.g. "example.com" becomes ".example.com" and matches "www.example.com" and "secure.example.com".
func FilecoinAddress ¶
func JWTKey ¶
JWTKey represents a JSON Web Token key for the server. Use this if you want to persist the key to disk. If This option is nil a random key will be generated.