Documentation ¶
Index ¶
- Constants
- func GetUser(ctx context.Context) (*common.User, error)
- type Auth
- type Configuration
- type Middleware
- func (a Middleware) Auth(ctx context.Context, token string) (*common.Session, error)
- func (a *Middleware) ExtensionName() string
- func (a *Middleware) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
- func (a Middleware) Middleware() graphql.HandlerExtension
- func (a Middleware) Start() (err error)
- func (a *Middleware) Validate(graphql.ExecutableSchema) error
- func (a Middleware) WsInitFunc(ctx context.Context, payload transport.InitPayload) (context.Context, *transport.InitPayload, error)
Constants ¶
View Source
const (
JwtDurationHour = 24
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth interface { Auth(ctx context.Context, token string) (*common.Session, error) Validate(ctx context.Context, jwt string) (*common.User, error) Middleware() graphql.HandlerExtension WsInitFunc(ctx context.Context, payload transport.InitPayload) (context.Context, *transport.InitPayload, error) Start() error }
type Configuration ¶
type Configuration struct { SecretPath string `envconfig:"SECRET_PATH" default:"AuthKey_39D5B439QV.p8"` Secret string TeamID string `envconfig:"TEAM_ID" required:"true"` ClientID string `envconfig:"CLIENT_ID" required:"true"` KeyID string `envconfig:"KEY_ID" required:"true"` }
func Config ¶
func Config() *Configuration
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func (*Middleware) ExtensionName ¶
func (a *Middleware) ExtensionName() string
func (*Middleware) InterceptResponse ¶
func (a *Middleware) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
func (Middleware) Middleware ¶
func (a Middleware) Middleware() graphql.HandlerExtension
func (*Middleware) Validate ¶
func (a *Middleware) Validate(graphql.ExecutableSchema) error
func (Middleware) WsInitFunc ¶
func (a Middleware) WsInitFunc(ctx context.Context, payload transport.InitPayload) (context.Context, *transport.InitPayload, error)
Click to show internal directories.
Click to hide internal directories.