Documentation
¶
Index ¶
- Constants
- Variables
- type AddOrgUserCommand
- type Address
- type ByOrgName
- type CreateOrgCommand
- type DeleteOrgCommand
- type GetOrgByIDQuery
- type GetOrgByNameQuery
- type GetOrgIDForNewUserCommand
- type GetOrgUsersQuery
- type GetUserOrgListQuery
- type Org
- type OrgDTO
- type OrgDetailsDTO
- type OrgUser
- type OrgUserDTO
- type RemoveOrgUserCommand
- type RoleType
- type SearchOrgUsersQuery
- type SearchOrgUsersQueryResult
- type SearchOrgsQuery
- type Service
- type UpdateOrgAddressCommand
- type UpdateOrgCommand
- type UpdateOrgUserCommand
- type UserOrgDTO
Constants ¶
View Source
const ( QuotaTargetSrv string = "org" OrgQuotaTarget string = "org" OrgUserQuotaTarget string = "org_user" )
Variables ¶
View Source
var ( ErrOrgNameTaken = errors.New("organization name is taken") ErrLastOrgAdmin = errors.New("cannot remove last organization admin") ErrOrgUserNotFound = errors.New("cannot find the organization user") ErrOrgUserAlreadyAdded = errors.New("user is already added to organization") ErrOrgNotFound = errutil.NewBase(errutil.StatusNotFound, "org.notFound", errutil.WithPublicMessage("organization not found")) ErrCannotChangeRoleForExternallySyncedUser = errutil.NewBase(errutil.StatusForbidden, "org.externallySynced", errutil.WithPublicMessage("cannot change role for externally synced user")) )
Typed errors
Functions ¶
This section is empty.
Types ¶
type AddOrgUserCommand ¶
type AddOrgUserCommand struct {
LoginOrEmail string `json:"loginOrEmail" binding:"Required"`
Role RoleType `json:"role" binding:"Required"`
OrgID int64 `json:"-" xorm:"org_id"`
UserID int64 `json:"-" xorm:"user_id"`
// internal use: avoid adding service accounts to orgs via user routes
AllowAddingServiceAccount bool `json:"-"`
}
type ByOrgName ¶
type ByOrgName []*UserOrgDTO
type CreateOrgCommand ¶
type DeleteOrgCommand ¶
type DeleteOrgCommand struct {
ID int64 `xorm:"id"`
}
type GetOrgByIDQuery ¶
type GetOrgByIDQuery struct {
ID int64
}
type GetOrgByNameQuery ¶
type GetOrgByNameQuery struct {
Name string
}
type GetOrgUsersQuery ¶
type GetUserOrgListQuery ¶
type GetUserOrgListQuery struct {
UserID int64 `xorm:"user_id"`
}
type OrgDetailsDTO ¶
type OrgUserDTO ¶
type OrgUserDTO struct {
OrgID int64 `json:"orgId" xorm:"org_id"`
UserID int64 `json:"userId" xorm:"user_id"`
Email string `json:"email"`
Name string `json:"name"`
AvatarURL string `json:"avatarUrl" xorm:"avatar_url"`
Login string `json:"login"`
Role string `json:"role"`
LastSeenAt time.Time `json:"lastSeenAt"`
Updated time.Time `json:"-"`
Created time.Time `json:"-"`
LastSeenAtAge string `json:"lastSeenAtAge"`
AccessControl map[string]bool `json:"accessControl,omitempty"`
IsDisabled bool `json:"isDisabled"`
AuthLabels []string `json:"authLabels" xorm:"-"`
IsExternallySynced bool `json:"isExternallySynced"`
}
type RemoveOrgUserCommand ¶
type SearchOrgUsersQuery ¶
type SearchOrgUsersQueryResult ¶
type SearchOrgUsersQueryResult struct {
TotalCount int64 `json:"totalCount"`
OrgUsers []*OrgUserDTO `json:"orgUsers"`
Page int `json:"page"`
PerPage int `json:"perPage"`
}
type SearchOrgsQuery ¶
type Service ¶
type Service interface {
GetIDForNewUser(context.Context, GetOrgIDForNewUserCommand) (int64, error)
InsertOrgUser(context.Context, *OrgUser) (int64, error)
DeleteUserFromAll(context.Context, int64) error
GetUserOrgList(context.Context, *GetUserOrgListQuery) ([]*UserOrgDTO, error)
UpdateOrg(context.Context, *UpdateOrgCommand) error
Search(context.Context, *SearchOrgsQuery) ([]*OrgDTO, error)
GetByID(context.Context, *GetOrgByIDQuery) (*Org, error)
GetByName(context.Context, *GetOrgByNameQuery) (*Org, error)
CreateWithMember(context.Context, *CreateOrgCommand) (*Org, error)
UpdateAddress(context.Context, *UpdateOrgAddressCommand) error
Delete(context.Context, *DeleteOrgCommand) error
GetOrCreate(context.Context, string) (int64, error)
AddOrgUser(context.Context, *AddOrgUserCommand) error
UpdateOrgUser(context.Context, *UpdateOrgUserCommand) error
RemoveOrgUser(context.Context, *RemoveOrgUserCommand) error
GetOrgUsers(context.Context, *GetOrgUsersQuery) ([]*OrgUserDTO, error)
SearchOrgUsers(context.Context, *SearchOrgUsersQuery) (*SearchOrgUsersQueryResult, error)
}
type UpdateOrgAddressCommand ¶
type UpdateOrgCommand ¶
type UpdateOrgUserCommand ¶
type UserOrgDTO ¶
Click to show internal directories.
Click to hide internal directories.