Documentation ¶
Index ¶
- Variables
- type AuthResolver
- func (r *AuthResolver) CurrentSession(ctx context.Context) (*models.SessionToken, error)
- func (r *AuthResolver) ListRolesAndPermissions(ctx context.Context, accountID uint64, order *models.RBACRoleListOrder) (*connectors.RBACRoleConnection, error)
- func (r *AuthResolver) Login(ctx context.Context, login string, password string) (*models.SessionToken, error)
- func (r *AuthResolver) Logout(ctx context.Context) (bool, error)
- func (r *AuthResolver) SwitchAccount(ctx context.Context, id uint64) (*models.SessionToken, error)
- type MemberQueryResolver
- func (r *MemberQueryResolver) Approve(ctx context.Context, memberID uint64, msg string) (*models.MemberPayload, error)
- func (r *MemberQueryResolver) Invite(ctx context.Context, accountID uint64, member models.InviteMemberInput) (*models.MemberPayload, error)
- func (r *MemberQueryResolver) List(ctx context.Context, filter *models.MemberListFilter, ...) (*connectors.MemberConnection, error)
- func (r *MemberQueryResolver) Reject(ctx context.Context, memberID uint64, msg string) (*models.MemberPayload, error)
- func (r *MemberQueryResolver) Remove(ctx context.Context, memberID uint64) (*models.MemberPayload, error)
- func (r *MemberQueryResolver) Update(ctx context.Context, memberID uint64, member models.MemberInput) (*models.MemberPayload, error)
- type QueryResolver
- func (r *QueryResolver) Account(ctx context.Context, id uint64) (*gqlmodels.AccountPayload, error)
- func (r *QueryResolver) ApproveAccount(ctx context.Context, id uint64, msg string) (*gqlmodels.AccountPayload, error)
- func (r *QueryResolver) CurrentAccount(ctx context.Context) (*gqlmodels.AccountPayload, error)
- func (r *QueryResolver) ListAccounts(ctx context.Context, filter *gqlmodels.AccountListFilter, ...) (*connectors.AccountConnection, error)
- func (r *QueryResolver) RegisterAccount(ctx context.Context, input *gqlmodels.AccountCreateInput) (*gqlmodels.AccountCreatePayload, error)
- func (r *QueryResolver) RejectAccount(ctx context.Context, id uint64, msg string) (*gqlmodels.AccountPayload, error)
- func (r *QueryResolver) UpdateAccount(ctx context.Context, id uint64, input *gqlmodels.AccountInput) (*gqlmodels.AccountPayload, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrAccountIDRequired = errors.New("account id is required")
)
Functions ¶
This section is empty.
Types ¶
type AuthResolver ¶
type AuthResolver struct {
// contains filtered or unexported fields
}
AuthResolver is the resolver for the Auth type
func NewAuthResolver ¶
func NewAuthResolver(provider *jwt.Provider, roleRepo rbac.Repository) *AuthResolver
NewAuthResolver creates new resolver for the Auth type
func (*AuthResolver) CurrentSession ¶
func (r *AuthResolver) CurrentSession(ctx context.Context) (*models.SessionToken, error)
CurrentSession is the resolver for the currentSession field
func (*AuthResolver) ListRolesAndPermissions ¶
func (r *AuthResolver) ListRolesAndPermissions(ctx context.Context, accountID uint64, order *models.RBACRoleListOrder) (*connectors.RBACRoleConnection, error)
ListRolesAndPermissions is the resolver for the listRolesAndPermissions field
func (*AuthResolver) Login ¶
func (r *AuthResolver) Login(ctx context.Context, login string, password string) (*models.SessionToken, error)
Login is the resolver for the login field
func (*AuthResolver) Logout ¶
func (r *AuthResolver) Logout(ctx context.Context) (bool, error)
Logout is the resolver for the logout field
func (*AuthResolver) SwitchAccount ¶
func (r *AuthResolver) SwitchAccount(ctx context.Context, id uint64) (*models.SessionToken, error)
SwitchAccount is the resolver for the switchAccount field
type MemberQueryResolver ¶
type MemberQueryResolver struct {
// contains filtered or unexported fields
}
func NewMemberQueryResolver ¶
func NewMemberQueryResolver() *MemberQueryResolver
func (*MemberQueryResolver) Approve ¶
func (r *MemberQueryResolver) Approve(ctx context.Context, memberID uint64, msg string) (*models.MemberPayload, error)
ApproveAccountMember is the resolver for the approveAccountMember field.
func (*MemberQueryResolver) Invite ¶
func (r *MemberQueryResolver) Invite(ctx context.Context, accountID uint64, member models.InviteMemberInput) (*models.MemberPayload, error)
Invite is the resolver for the inviteAccountMember field.
func (*MemberQueryResolver) List ¶
func (r *MemberQueryResolver) List(ctx context.Context, filter *models.MemberListFilter, order *models.MemberListOrder, page *models.Page) (*connectors.MemberConnection, error)
List is the resolver for the listMembers field.
func (*MemberQueryResolver) Reject ¶
func (r *MemberQueryResolver) Reject(ctx context.Context, memberID uint64, msg string) (*models.MemberPayload, error)
Reject is the resolver for the rejectAccountMember field.
func (*MemberQueryResolver) Remove ¶
func (r *MemberQueryResolver) Remove(ctx context.Context, memberID uint64) (*models.MemberPayload, error)
Remove is the resolver for the removeAccountMember field.
func (*MemberQueryResolver) Update ¶
func (r *MemberQueryResolver) Update(ctx context.Context, memberID uint64, member models.MemberInput) (*models.MemberPayload, error)
Update is the resolver for the updateAccountMember field.
type QueryResolver ¶
type QueryResolver struct {
// contains filtered or unexported fields
}
QueryResolver implements GQL API methods
func NewQueryResolver ¶
func NewQueryResolver() *QueryResolver
NewQueryResolver returns new API resolver
func (*QueryResolver) Account ¶
func (r *QueryResolver) Account(ctx context.Context, id uint64) (*gqlmodels.AccountPayload, error)
Account returns the account info
func (*QueryResolver) ApproveAccount ¶
func (r *QueryResolver) ApproveAccount(ctx context.Context, id uint64, msg string) (*gqlmodels.AccountPayload, error)
ApproveAccount is the resolver for the approveAccount field.
func (*QueryResolver) CurrentAccount ¶
func (r *QueryResolver) CurrentAccount(ctx context.Context) (*gqlmodels.AccountPayload, error)
CurrentAccount returns the current account info
func (*QueryResolver) ListAccounts ¶
func (r *QueryResolver) ListAccounts(ctx context.Context, filter *gqlmodels.AccountListFilter, order *gqlmodels.AccountListOrder, page *gqlmodels.Page, ) (*connectors.AccountConnection, error)
ListAccounts list by filter
func (*QueryResolver) RegisterAccount ¶
func (r *QueryResolver) RegisterAccount(ctx context.Context, input *gqlmodels.AccountCreateInput) (*gqlmodels.AccountCreatePayload, error)
RegisterAccount creates a new account
func (*QueryResolver) RejectAccount ¶
func (r *QueryResolver) RejectAccount(ctx context.Context, id uint64, msg string) (*gqlmodels.AccountPayload, error)
RejectAccount is the resolver for the rejectAccount field.
func (*QueryResolver) UpdateAccount ¶
func (r *QueryResolver) UpdateAccount(ctx context.Context, id uint64, input *gqlmodels.AccountInput) (*gqlmodels.AccountPayload, error)
UpdateAccount is the resolver for the updateAccount field.