app

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 70 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRequiredMiddleware added in v0.6.0

func AuthRequiredMiddleware() echo.MiddlewareFunc

func ContextMiddleware added in v0.6.0

func ContextMiddleware(fn func(ctx context.Context) context.Context) echo.MiddlewareFunc

func ExportLayer added in v0.6.0

func ExportLayer() echo.HandlerFunc

func GraphqlAPI added in v0.6.0

func GraphqlAPI(
	conf GraphQLConfig,
	dev bool,
) echo.HandlerFunc

func PasswordReset added in v0.6.0

func PasswordReset() echo.HandlerFunc

func Ping added in v0.6.0

func Ping() echo.HandlerFunc

func PublishedAuthMiddleware

func PublishedAuthMiddleware() echo.MiddlewareFunc

func PublishedData

func PublishedData() echo.HandlerFunc

func PublishedIndex

func PublishedIndex() echo.HandlerFunc

func PublishedMetadata added in v0.6.0

func PublishedMetadata() echo.HandlerFunc

func Signup added in v0.6.0

func Signup() echo.HandlerFunc

func SignupVerify added in v0.6.0

func SignupVerify() echo.HandlerFunc

func Start

func Start(debug bool, version string)

func StartSignupVerify added in v0.6.0

func StartSignupVerify() echo.HandlerFunc

func UsecaseMiddleware added in v0.6.0

func UsecaseMiddleware(r *repo.Container, g *gateway.Container, config interactor.ContainerConfig) echo.MiddlewareFunc

Types

type Auth0Config

type Auth0Config struct {
	Domain       string
	Audience     string
	ClientID     string
	ClientSecret string
	WebClientID  string
}

func (Auth0Config) AuthConfig added in v0.6.0

func (c Auth0Config) AuthConfig() *AuthConfig

type AuthConfig added in v0.6.0

type AuthConfig struct {
	ISS      string
	AUD      []string
	ALG      *string
	TTL      *int
	ClientID *string
}

type AuthConfigs added in v0.6.0

type AuthConfigs []AuthConfig

func (*AuthConfigs) Decode added in v0.6.0

func (ipd *AuthConfigs) Decode(value string) error

Decode is a custom decoder for AuthConfigs

type AuthSrvConfig added in v0.6.0

type AuthSrvConfig struct {
	Dev      bool
	Disabled bool
	Domain   string
	UIDomain string
	Key      string
	DN       *AuthSrvDNConfig
}

func (AuthSrvConfig) AuthConfig added in v0.6.0

func (c AuthSrvConfig) AuthConfig(debug bool, host string) *AuthConfig

type AuthSrvDNConfig added in v0.6.0

type AuthSrvDNConfig struct {
	CN         string
	O          []string
	OU         []string
	C          []string
	L          []string
	ST         []string
	Street     []string
	PostalCode []string
}

type Config

type Config struct {
	Port           string `default:"8080" envconfig:"PORT"`
	ServerHost     string
	Host           string `default:"http://localhost:8080"`
	Host_Web       string
	Dev            bool
	DB             string `default:"mongodb://localhost"`
	Mailer         string
	SMTP           SMTPConfig
	SendGrid       SendGridConfig
	GraphQL        GraphQLConfig
	Published      PublishedConfig
	GCPProject     string `envconfig:"GOOGLE_CLOUD_PROJECT"`
	Profiler       string
	Tracer         string
	TracerSample   float64
	GCS            GCSConfig
	AssetBaseURL   string `default:"http://localhost:8080/assets"`
	Origins        []string
	Web            WebConfig
	SignupSecret   string
	SignupDisabled bool
	// auth
	Auth          AuthConfigs
	Auth0         Auth0Config
	AuthSrv       AuthSrvConfig
	Auth_ISS      string
	Auth_AUD      string
	Auth_ALG      *string
	Auth_TTL      *int
	Auth_ClientID *string
}

func ReadConfig

func ReadConfig(debug bool) (*Config, error)

func (Config) AuthServeDomainURL added in v0.6.0

func (c Config) AuthServeDomainURL() *url.URL

func (Config) AuthServeUIDomainURL added in v0.6.0

func (c Config) AuthServeUIDomainURL() *url.URL

func (Config) Auths added in v0.6.0

func (c Config) Auths() (res []AuthConfig)

func (Config) HostURL added in v0.6.0

func (c Config) HostURL() *url.URL

func (Config) HostWebURL added in v0.6.0

func (c Config) HostWebURL() *url.URL

func (Config) Print

func (c Config) Print() string

type GCSConfig

type GCSConfig struct {
	BucketName              string
	PublicationCacheControl string
}

type GraphQLConfig

type GraphQLConfig struct {
	ComplexityLimit int `default:"6000"`
}

type Logger

type Logger struct{}

Logrus : implement Logger

func GetEchoLogger

func GetEchoLogger() *Logger

GetEchoLogger for e.Logger

func (*Logger) Debug

func (l *Logger) Debug(i ...interface{})

Debug string log

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

Debugf debug json log

func (*Logger) Debugj

func (l *Logger) Debugj(j log.JSON)

Debugj debug json log

func (*Logger) Error

func (l *Logger) Error(i ...interface{})

Error string log

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf error json log

func (*Logger) Errorj

func (l *Logger) Errorj(j log.JSON)

Errorj error json log

func (*Logger) Fatal

func (l *Logger) Fatal(i ...interface{})

Fatal string log

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

Fatalf fatal json log

func (*Logger) Fatalj

func (l *Logger) Fatalj(j log.JSON)

Fatalj fatal json log

func (*Logger) Hook

func (l *Logger) Hook() echo.MiddlewareFunc

Hook is a function to process middleware.

func (*Logger) Info

func (l *Logger) Info(i ...interface{})

Info string log

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

Infof info json log

func (*Logger) Infoj

func (l *Logger) Infoj(j log.JSON)

Infoj info json log

func (*Logger) Level

func (l *Logger) Level() log.Lvl

Level returns logger level

func (*Logger) Output

func (l *Logger) Output() io.Writer

Output logger output func

func (*Logger) Panic

func (l *Logger) Panic(i ...interface{})

Panic string log

func (*Logger) Panicf

func (l *Logger) Panicf(format string, args ...interface{})

Panicf panic json log

func (*Logger) Panicj

func (l *Logger) Panicj(j log.JSON)

Panicj panic json log

func (*Logger) Prefix

func (l *Logger) Prefix() string

Prefix It's controlled by Logger

func (*Logger) Print

func (l *Logger) Print(i ...interface{})

Print string log

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

Printf print json log

func (*Logger) Printj

func (l *Logger) Printj(j log.JSON)

Printj print json log

func (*Logger) SetHeader

func (l *Logger) SetHeader(_ string)

SetHeader is a stub to satisfy interface It's controlled by Logger

func (*Logger) SetLevel

func (l *Logger) SetLevel(lvl log.Lvl)

SetLevel set level to logger from given log.Lvl

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput change output, default os.Stdout

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(s string)

SetPrefix It's controlled by Logger

func (*Logger) Warn

func (l *Logger) Warn(i ...interface{})

Warn string log

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

Warnf warning json log

func (*Logger) Warnj

func (l *Logger) Warnj(j log.JSON)

Warnj warning json log

type MultiValidator added in v0.6.0

type MultiValidator []*validator.Validator

func NewMultiValidator added in v0.6.0

func NewMultiValidator(providers []AuthConfig) (MultiValidator, error)

func (MultiValidator) ValidateToken added in v0.6.0

func (mv MultiValidator) ValidateToken(ctx context.Context, tokenString string) (res interface{}, err error)

ValidateToken Trys to validate the token with each validator NOTE: the last validation error only is returned

type PublishedConfig

type PublishedConfig struct {
	IndexURL *url.URL
}

type SMTPConfig added in v0.6.0

type SMTPConfig struct {
	Host         string
	Port         string
	SMTPUsername string
	Email        string
	Password     string
}

type SendGridConfig added in v0.6.0

type SendGridConfig struct {
	Email string
	Name  string
	API   string
}

type ServerConfig

type ServerConfig struct {
	Config   *Config
	Debug    bool
	Repos    *repo.Container
	Gateways *gateway.Container
}

type WebConfig

type WebConfig map[string]string

type WebServer

type WebServer struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, cfg *ServerConfig) *WebServer

func (*WebServer) Run

func (w *WebServer) Run()

Jump to

Keyboard shortcuts

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