Documentation ¶
Index ¶
- Constants
- type APIStatus
- type ApiToken
- type ApiTokenInput
- type Audit
- type CreateProjectInput
- type DeleteApiTokenInput
- type DeleteProjectInput
- type Invitation
- type ListInvitationResponse
- type ListProjectInputFilter
- type ListProjectRequest
- type ListProjectResponse
- type Member
- type MemberInput
- type MemberRole
- type MemberStat
- type Members
- type Owner
- type Pagination
- type Project
- type ProjectInput
- type ProjectSortingField
- type ProjectStats
- type ResourceDetails
- type RevokedToken
- type Role
- type SortInput
- type State
- type UpdateUserState
- type User
- type UserDetailResponse
- type UserDetails
- type UserPassword
- type UserWithProject
Constants ¶
const ( ProjectName = "projectName" SortField = "sortField" Ascending = "sortAscending" CreatedByMe = "createdByMe" Page = "page" Limit = "limit" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIStatus ¶
type APIStatus struct {
Status string `json:"status"`
}
APIStatus defines structure for APIroute status
type ApiToken ¶
type ApiToken struct { UserID string `bson:"user_id" json:"user_id"` Name string `bson:"name" json:"name"` Token string `bson:"token" json:"token"` ExpiresAt int64 `bson:"expires_at" json:"expires_at"` CreatedAt int64 `bson:"created_at" json:"created_at"` }
ApiToken struct for storing API tokens
type ApiTokenInput ¶
type ApiTokenInput struct { UserID string `json:"user_id"` Name string `json:"name"` DaysUntilExpiration int `json:"days_until_expiration"` }
ApiTokenInput struct for storing ApiTokenInput
type Audit ¶
type Audit struct { UpdatedAt int64 `bson:"updated_at" json:"updatedAt"` CreatedAt int64 `bson:"created_at" json:"createdAt"` CreatedBy UserDetailResponse `bson:"created_by" json:"createdBy"` UpdatedBy UserDetailResponse `bson:"updated_by" json:"updatedBy"` IsRemoved bool `bson:"is_removed" json:"isRemoved"` }
type CreateProjectInput ¶
type DeleteApiTokenInput ¶
DeleteApiTokenInput struct for storing DeleteApiTokenInput
type DeleteProjectInput ¶
type DeleteProjectInput struct {
ProjectID string `json:"projectID"`
}
type Invitation ¶
type Invitation string
Invitation defines the type of the invitation that is sent by the Owner of the project to other users
const ( // PendingInvitation is the state when the Invitation is sent but not accepted PendingInvitation Invitation = "Pending" // AcceptedInvitation is the state when the Invitation is accepted AcceptedInvitation Invitation = "Accepted" // DeclinedInvitation is the state when the Invitation is rejected/declined DeclinedInvitation Invitation = "Declined" // ExitedProject is the state when the user has exited the project ExitedProject Invitation = "Exited" )
type ListInvitationResponse ¶
type ListInvitationResponse struct { ProjectID string `json:"projectID"` ProjectName string `json:"projectName"` ProjectOwner Member `json:"projectOwner"` InvitationRole MemberRole `json:"invitationRole"` }
type ListProjectInputFilter ¶
type ListProjectRequest ¶
type ListProjectRequest struct { UserID string `json:"userID"` Sort *SortInput `json:"sort,omitempty"` Filter *ListProjectInputFilter `json:"filter,omitempty"` Pagination *Pagination `json:"pagination,omitempty"` }
type ListProjectResponse ¶
type Member ¶
type Member struct { UserID string `bson:"user_id" json:"userID"` Username string `bson:"username" json:"username"` Email string `bson:"email" json:"email"` Name string `bson:"name" json:"name"` Role MemberRole `bson:"role" json:"role"` Invitation Invitation `bson:"invitation" json:"invitation"` JoinedAt int64 `bson:"joined_at" json:"joinedAt"` DeactivatedAt *int64 `bson:"deactivated_at,omitempty" json:"deactivatedAt,omitempty"` }
Member contains the required fields to be stored in the database for a member
func (*Member) GetMemberOutput ¶
GetMemberOutput takes a Member struct as input and returns the graphQL model equivalent
type MemberInput ¶
type MemberInput struct { ProjectID string `json:"projectID"` UserID string `json:"userID"` Role *MemberRole `json:"role"` }
type MemberRole ¶
type MemberRole string
MemberRole defines the project role a member has in the project
const ( RoleOwner MemberRole = "Owner" RoleExecutor MemberRole = "Executor" RoleViewer MemberRole = "Viewer" )
type MemberStat ¶
type Owner ¶
type Owner struct { UserID string `bson:"user_id" json:"userID"` Username string `bson:"username" json:"username"` Invitation Invitation `bson:"invitation" json:"invitation"` JoinedAt int64 `bson:"joined_at" json:"joinedAt"` DeactivatedAt *int64 `bson:"deactivated_at,omitempty" json:"deactivatedAt,omitempty"` }
type Pagination ¶
type Project ¶
type Project struct { Audit `bson:",inline"` ID string `bson:"_id" json:"projectID"` Name string `bson:"name" json:"name"` Members []*Member `bson:"members" json:"members"` State *string `bson:"state" json:"state"` Tags []*string `bson:"tags" json:"tags"` Description *string `bson:"description" json:"description"` }
Project contains the required fields to be stored in the database for a project
func (*Project) GetMemberOutput ¶
GetMemberOutput takes a Project struct as input and returns the graphQL model equivalent for a members of the project
func (*Project) GetProjectOutput ¶
GetProjectOutput takes a Project struct as input and returns the graphQL model equivalent
type ProjectInput ¶
type ProjectSortingField ¶
type ProjectSortingField string
const ( ProjectSortingFieldName ProjectSortingField = "NAME" ProjectSortingFieldTime ProjectSortingField = "TIME" )
type ProjectStats ¶
type ProjectStats struct { Name string `bson:"name" json:"name"` ProjectID string `bson:"_id" json:"projectID"` Members *MemberStat `bson:"memberStat" json:"members"` }
type ResourceDetails ¶
type RevokedToken ¶
type RevokedToken struct { Token string `bson:"token"` ExpiresAt int64 `bson:"expires_at"` CreatedAt int64 `bson:"created_at"` }
RevokedToken struct for storing revoked tokens
type SortInput ¶
type SortInput struct { Field *ProjectSortingField `json:"field"` Ascending *bool `json:"ascending"` }
type UpdateUserState ¶
type UpdateUserState struct { Username string `json:"username"` IsDeactivate *bool `json:"isDeactivate"` }
UpdateUserState defines structure to deactivate or reactivate user
type User ¶
type User struct { Audit `bson:",inline"` ID string `bson:"_id,omitempty" json:"userID"` Username string `bson:"username,omitempty" json:"username"` Password string `bson:"password,omitempty" json:"password,omitempty"` Salt string `bson:"salt" json:"salt"` Email string `bson:"email,omitempty" json:"email,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` Role Role `bson:"role,omitempty" json:"role"` DeactivatedAt *int64 `bson:"deactivated_at,omitempty" json:"deactivatedAt,omitempty"` IsInitialLogin bool `bson:"is_initial_login" json:"isInitialLogin"` }
User contains the user information
func (*User) IsEmailValid ¶
IsEmailValid validates the email
func (*User) SanitizedUser ¶
SanitizedUser returns the user object without sensitive information
type UserDetailResponse ¶
type UserDetails ¶
type UserDetails struct { ID string `bson:"id,omitempty"` Email string `bson:"email,omitempty" json:"email,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` }
UserDetails is used to update user's personal details
type UserPassword ¶
type UserPassword struct { Username string `json:"username,omitempty"` OldPassword string `json:"oldPassword,omitempty"` NewPassword string `json:"newPassword,omitempty"` }
UserPassword defines structure for password related requests