Documentation ¶
Index ¶
- Constants
- func InitializeGraphQLSchema(container app.Container) *graphql.Schema
- func SetupGraphQLHandler(router *gin.Engine, container app.Container)
- func SetupHomeHandler(router *gin.Engine, container app.Container)
- func SetupOAuth2GoogleHandler(router *gin.Engine, container app.Container)
- func SetupRepositories(container app.Container, conf *Conf)
- func SetupSessionMiddleware(sessionProvider interface{ ... }) gin.HandlerFunc
- func SetupUserTokenMiddleware(tokenProvider interface{ ... }) gin.HandlerFunc
- func SetupUserTokenSerializer(container app.Container, conf *Conf)
- type Conf
- type ContainerInjector
- type Database
- type GraphQL
- type GraphQLHandler
- type HomeHandler
- type JWTConf
- type Labeltile
- type OAuth2Conf
- type OAuth2GoogleConf
- type OAuth2GoogleHandler
- type RouteInjector
- type ServerConf
- type SessionMiddleware
- type UserTokenMiddleware
Constants ¶
const (
// CtxSessionIDKey is for handling session id in Context
CtxSessionIDKey = "sessionID"
)
Variables ¶
This section is empty.
Functions ¶
func InitializeGraphQLSchema ¶
InitializeGraphQLSchema provides type initialization for GraphQL
func SetupGraphQLHandler ¶
SetupGraphQLHandler provides initializing GraphQLHandler and binding its controller and endpoint
func SetupHomeHandler ¶
SetupHomeHandler provides initializing HomeHandler and binding its controller and endpoint
func SetupOAuth2GoogleHandler ¶
SetupOAuth2GoogleHandler provides initializing OAuth2GoogleHandler and binding its controller and endpoint
func SetupRepositories ¶
SetupRepositories provides initializing repositories and setting to container
func SetupSessionMiddleware ¶
func SetupSessionMiddleware(sessionProvider interface { SessionStorage() app.SessionStorage }) gin.HandlerFunc
SetupSessionMiddleware provides session storage operation request by request
func SetupUserTokenMiddleware ¶
func SetupUserTokenMiddleware(tokenProvider interface { UserTokenSerializer() app.UserTokenSerializer }) gin.HandlerFunc
SetupUserTokenMiddleware provides deserialization token from header and serialization token to header
func SetupUserTokenSerializer ¶
SetupUserTokenSerializer provides setting UserTokenSerializer into containter
Types ¶
type Conf ¶
type Conf struct { Server ServerConf `toml:"server"` JWT JWTConf `toml:"jwt"` OAuth2 OAuth2Conf `toml:"oauth2"` Database Database `toml:"database"` }
Conf is configuration binder
type ContainerInjector ¶
ContainerInjector is alias for infra module injection using Functional Option Pattern
type GraphQL ¶
GraphQL provides variable, query and user grouping per request for GraphQL execution
func NewGraphQLRequest ¶
NewGraphQLRequest returns Request object with json and token validation
type GraphQLHandler ¶
type GraphQLHandler struct {
// contains filtered or unexported fields
}
GraphQLHandler provides controllers for graphql requests
func (*GraphQLHandler) Run ¶
func (h *GraphQLHandler) Run(c *gin.Context)
Run is controller for graphql request
type HomeHandler ¶
type HomeHandler struct {
// contains filtered or unexported fields
}
HomeHandler provides controllers for toppage
type JWTConf ¶
type JWTConf struct { SecretKey string `toml:"secret_key"` ExpireHour uint32 `toml:"expire_hour"` SigningMethod string `toml:"signing_method"` }
JWTConf provides configuration for JSON Web Token
type Labeltile ¶
type Labeltile struct {
// contains filtered or unexported fields
}
Labeltile is main interface of this application
func NewLabeltile ¶
func NewLabeltile(conf *Conf, injectFns ...ContainerInjector) *Labeltile
NewLabeltile returns Labeltile object
func (*Labeltile) SetupRoutes ¶
func (l *Labeltile) SetupRoutes(injectFns ...RouteInjector)
SetupRoutes provides filling routing in gin framework
type OAuth2Conf ¶
type OAuth2Conf struct {
Google OAuth2GoogleConf `toml:"google"`
}
OAuth2Conf provides oauth2 conf section
type OAuth2GoogleConf ¶
type OAuth2GoogleConf struct { ClientID string `toml:"client_id"` ClientSecret string `toml:"client_secret"` RedirectURL string `toml:"redirect_url"` }
OAuth2GoogleConf provides configuration for google oauth2
func (OAuth2GoogleConf) IsValid ¶
func (c OAuth2GoogleConf) IsValid() bool
IsValid returns whether OAuth2GoogleConf data structure is valid or not
type OAuth2GoogleHandler ¶
type OAuth2GoogleHandler struct {
// contains filtered or unexported fields
}
OAuth2GoogleHandler provides controllers for oauth authorization by google
func (*OAuth2GoogleHandler) Access ¶
func (h *OAuth2GoogleHandler) Access(c *gin.Context)
Access is controller for oauth page redirection to google
func (*OAuth2GoogleHandler) Callback ¶
func (h *OAuth2GoogleHandler) Callback(c *gin.Context)
Callback is controller for rediret page from google when authorized
type RouteInjector ¶
RouteInjector is alias for binding endpoint and controller implementation using Functional Option Pattern
type ServerConf ¶
ServerConf provides configuration for Web Server
func (ServerConf) IsValid ¶
func (c ServerConf) IsValid() bool
IsValid returns whether ServerConf data structure is valid or not
type SessionMiddleware ¶
type SessionMiddleware struct {
// contains filtered or unexported fields
}
SessionMiddleware provides framework's whole request filter using SessionStorage
func (*SessionMiddleware) Execute ¶
func (m *SessionMiddleware) Execute(c *gin.Context)
Execute provides wrapping request by SessionMiddleware
type UserTokenMiddleware ¶
type UserTokenMiddleware struct {
// contains filtered or unexported fields
}
UserTokenMiddleware provides framework's whole request filter using UserTokenSerializer
func (*UserTokenMiddleware) Execute ¶
func (m *UserTokenMiddleware) Execute(c *gin.Context)
Execute provides wrapping request by UserTokenMiddleware