Documentation ¶
Index ¶
- Constants
- Variables
- func Marshal_Any(v interface{}) graphql.Marshaler
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func Unmarshal_Any(v interface{}) (interface{}, error)
- type Client
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type EventController
- type ForgotPasswordRequest
- type IDPClient
- type IDPUser
- type IDPUserResponse
- type IDUser
- type MutationResolver
- type QueryResolver
- type RequestStore
- func (s *RequestStore) CreateActivationRequest(userId string) (r *UserActivationRequest, err error)
- func (s *RequestStore) CreateForgotPasswordRequest(userId string) (r *ForgotPasswordRequest, err error)
- func (s *RequestStore) CreateInvitationRequest(userId string) (r *UserInvitationRequest, err error)
- func (s *RequestStore) DeleteForgotPasswordRequest(id string) (r *ForgotPasswordRequest, err error)
- func (s *RequestStore) DeleteInvitationRequest(id string) (r *UserInvitationRequest, err error)
- func (s *RequestStore) GetForgotPasswordRequest(id string) (r *ForgotPasswordRequest, err error)
- func (s *RequestStore) GetInvitationRequest(id string) (r *UserInvitationRequest, err error)
- type Resolver
- type ResolverRoot
- type User
- type UserActivationRequest
- type UserGender
- type UserInfo
- type UserInvitationRequest
- type UserInvitationRequestEvent
- type UserProviderGetResponse
- type UserProviderInviteResponse
- type UserStore
- func (s *UserStore) FindUserByEmail(ctx context.Context, email string) (u *User, err error)
- func (s *UserStore) GetUser(ctx context.Context, id string) (u *User, err error)
- func (s *UserStore) GetUsers(ctx context.Context, ids []string) (u []User, err error)
- func (s *UserStore) InviteUser(ctx context.Context, email string, userInfo *UserInfo) (u *User, new bool, err error)
- func (s *UserStore) UpdateUser(ctx context.Context, id string, info *UserInfo) (u *User, err error)
Constants ¶
View Source
const ( UserInvitedEvent = "com.graphql.id.user.invited" ForgotPasswordEvent = "com.graphql.id.user.forgot-password" )
View Source
const (
SchemaSDL string = `` /* 2183-byte string literal not displayed */
)
Variables ¶
View Source
var AllUserGender = []UserGender{ UserGenderMale, UserGenderFemale, }
Functions ¶
func Marshal_Any ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func Unmarshal_Any ¶
func Unmarshal_Any(v interface{}) (interface{}, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client ...
type ComplexityRoot ¶
type ComplexityRoot struct { Mutation struct { ActivateUser func(childComplexity int, requestID string, info *UserInfo) int ConfirmInvitation func(childComplexity int, requestID string, password string, info *UserInfo) int ForgotPassword func(childComplexity int, email string) int InviteUser func(childComplexity int, email string, userInfo *UserInfo) int RegisterUser func(childComplexity int, email string, password string, info *UserInfo) int ResetPassword func(childComplexity int, requestID string, newPassword string) int UpdatePassword func(childComplexity int, oldPassword string, newPassword string) int UpdateUser func(childComplexity int, info UserInfo) int } Query struct { User func(childComplexity int, id string) int // contains filtered or unexported fields } User struct { Address func(childComplexity int) int Birthdate func(childComplexity int) int CreatedAt func(childComplexity int) int Email func(childComplexity int) int EmailVerified func(childComplexity int) int FamilyName func(childComplexity int) int Gender func(childComplexity int) int GivenName func(childComplexity int) int ID func(childComplexity int) int Locale func(childComplexity int) int MiddleName func(childComplexity int) int Nickname func(childComplexity int) int PhoneNumber func(childComplexity int) int PhoneNumberVerified func(childComplexity int) int Picture func(childComplexity int) int PreferredUsername func(childComplexity int) int Profile func(childComplexity int) int UpdatedAt func(childComplexity int) int Website func(childComplexity int) int Zoneinfo func(childComplexity int) int } // contains filtered or unexported fields }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type EventController ¶
type EventController struct {
// contains filtered or unexported fields
}
func NewEventController ¶
func NewEventController() (ec EventController, err error)
func (*EventController) SendForgotPasswordRequest ¶
func (c *EventController) SendForgotPasswordRequest(ctx context.Context, r *ForgotPasswordRequest, u *User) (err error)
func (*EventController) SendUserInvitationRequest ¶
func (c *EventController) SendUserInvitationRequest(ctx context.Context, r *UserInvitationRequest, u *User) (err error)
type ForgotPasswordRequest ¶
type IDPClient ¶
type IDPClient struct {
URL string
}
func NewIDPClient ¶
func NewIDPClient() *IDPClient
func (*IDPClient) ChangePassword ¶
type IDPUserResponse ¶
type IDPUserResponse struct {
Result IDPUser
}
type IDUser ¶
type IDUser struct { ID string `json:"id" gorm:"primary_key"` Name string `json:"name"` Email string `json:"email"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` MiddleName string `json:"middle_name"` }
IDUser ...
type MutationResolver ¶
type MutationResolver interface { InviteUser(ctx context.Context, email string, userInfo *UserInfo) (*User, error) ForgotPassword(ctx context.Context, email string) (bool, error) RegisterUser(ctx context.Context, email string, password string, info *UserInfo) (*User, error) ConfirmInvitation(ctx context.Context, requestID string, password string, info *UserInfo) (*User, error) ActivateUser(ctx context.Context, requestID string, info *UserInfo) (bool, error) ResetPassword(ctx context.Context, requestID string, newPassword string) (bool, error) UpdateUser(ctx context.Context, info UserInfo) (*User, error) UpdatePassword(ctx context.Context, oldPassword string, newPassword string) (bool, error) }
type QueryResolver ¶
type RequestStore ¶
func (*RequestStore) CreateActivationRequest ¶
func (s *RequestStore) CreateActivationRequest(userId string) (r *UserActivationRequest, err error)
func (*RequestStore) CreateForgotPasswordRequest ¶
func (s *RequestStore) CreateForgotPasswordRequest(userId string) (r *ForgotPasswordRequest, err error)
func (*RequestStore) CreateInvitationRequest ¶
func (s *RequestStore) CreateInvitationRequest(userId string) (r *UserInvitationRequest, err error)
func (*RequestStore) DeleteForgotPasswordRequest ¶
func (s *RequestStore) DeleteForgotPasswordRequest(id string) (r *ForgotPasswordRequest, err error)
func (*RequestStore) DeleteInvitationRequest ¶
func (s *RequestStore) DeleteInvitationRequest(id string) (r *UserInvitationRequest, err error)
func (*RequestStore) GetForgotPasswordRequest ¶
func (s *RequestStore) GetForgotPasswordRequest(id string) (r *ForgotPasswordRequest, err error)
func (*RequestStore) GetInvitationRequest ¶
func (s *RequestStore) GetInvitationRequest(id string) (r *UserInvitationRequest, err error)
type Resolver ¶
type Resolver struct { UserStore *UserStore RequestStore *RequestStore IDPClient *IDPClient EventController *EventController }
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
type User ¶
type User struct { ID string `json:"id"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` GivenName *string `json:"given_name"` FamilyName *string `json:"family_name"` MiddleName *string `json:"middle_name"` Nickname *string `json:"nickname"` PreferredUsername *string `json:"preferred_username"` Profile *string `json:"profile"` Picture *string `json:"picture"` Website *string `json:"website"` Gender *UserGender `json:"gender"` Birthdate *time.Time `json:"birthdate"` Zoneinfo *string `json:"zoneinfo"` Locale *string `json:"locale"` PhoneNumber *string `json:"phone_number"` PhoneNumberVerified *string `json:"phone_number_verified"` Address *string `json:"address"` UpdatedAt *time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` }
type UserActivationRequest ¶
type UserGender ¶
type UserGender string
const ( UserGenderMale UserGender = "male" UserGenderFemale UserGender = "female" )
func (UserGender) IsValid ¶
func (e UserGender) IsValid() bool
func (UserGender) MarshalGQL ¶
func (e UserGender) MarshalGQL(w io.Writer)
func (UserGender) String ¶
func (e UserGender) String() string
func (*UserGender) UnmarshalGQL ¶
func (e *UserGender) UnmarshalGQL(v interface{}) error
type UserInfo ¶
type UserInfo struct { GivenName *string `json:"given_name"` FamilyName *string `json:"family_name"` MiddleName *string `json:"middle_name"` Nickname *string `json:"nickname"` PreferredUsername *string `json:"preferred_username"` Profile *string `json:"profile"` Picture *string `json:"picture"` Website *string `json:"website"` Gender *UserGender `json:"gender"` Birthdate *time.Time `json:"birthdate"` Zoneinfo *string `json:"zoneinfo"` Locale *string `json:"locale"` PhoneNumber *string `json:"phone_number"` PhoneNumberVerified *string `json:"phone_number_verified"` Address *string `json:"address"` }
func (UserInfo) UpdateUser ¶
type UserInvitationRequest ¶
type UserProviderGetResponse ¶
type UserProviderGetResponse struct {
Result IDUser
}
UserProviderGetResponse ...
type UserProviderInviteResponse ¶
type UserProviderInviteResponse struct {
Result IDUser
}
UserProviderInviteResponse ...
type UserStore ¶
func (*UserStore) FindUserByEmail ¶
func (*UserStore) InviteUser ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.