Documentation ¶
Overview ¶
Package member provides access to the club member of the Buddy System.
Package member provides access to the club member of the Buddy System.
Index ¶
Constants ¶
const ( MASTER = "MASTER" Attending = iota Absent Graduate )
Variables ¶
var ( ErrIdentityMismatch = errors.New("계정 정보를 확인해주세요") ErrAlreadyMember = errors.New("이미 등록된 사용자입니다") ErrUnderReview = errors.New("승인 검토 중입니다") ErrOnDelete = errors.New("이미 탈퇴 신청하셨습니다") ErrAlreadyActive = errors.New("already active") ErrAlreadyInactive = errors.New("already inactive") ErrPermissionDenied = errors.New("권한이 없습니다") )
Functions ¶
func Activate ¶
Activate updates the activation status for member signup.
NOTE:
It is a privileged operation:
Only the club managers can access to this operation.
func Approve ¶
Approve approves the signup requests of ids.
NOTE:
It is a privileged operation:
Only the club managers can access to this operation.
func Delete ¶
Delete deletes the members of ids.
NOTE:
It is a privileged operation:
Only the club managers can access to this operation.
func UpdateRole ¶
UpdateRole updates the role of member of id.
NOTE:
It is a privileged operation:
Only the club managers can access to this operation.
Types ¶
type Member ¶
type Member struct { ID string `json:"id" bson:"id"` // student ID Password string `json:"password" bson:"password"` // password Name string `json:"name" bson:"name"` // Name Department string `json:"department" bson:"department"` // department Phone string `json:"phone" bson:"phone"` // phone number Email string `json:"email" bson:"email"` // e-mail address Grade int `json:"grade" bson:"grade"` // grade Attendance int `json:"attendance" bson:"attendance"` // attendance status (attending/absent/graduate) Approved bool `json:"approved" bson:"approved"` // approved or not OnDelete bool `json:"on_delete" bson:"on_delete"` // on exit process or not CreatedAt int64 `json:"created_at,string" bson:"created_at"` // when created - Unix timestamp UpdatedAt int64 `json:"updated_at,string" bson:"updated_at"` // last updated - Unix timestamp Role Role `json:"role" bson:"role"` // role of member }
Member represents a club member state.
func (*Member) Exit ¶
Exit applies an exit of m.
NOTE:
It is a member-limited operation:
Only the authenticated members can access to this operation.
func (Member) SignUp ¶
SignUp applies a membership of m. If m already exists (approved or not), nothing changes. Else it registers an unapproved member.
type Members ¶
type Members []Member
func Exits ¶
Exits returns the exit request list.
NOTE:
It is a privileged operation:
Only the club managers can access to this operation.
func Graduates ¶
Graduates returns all graduate members.
NOTE:
It is a privileged operation:
Only the club managers can access to this operation.
func Search ¶
Search returns the search result with query.
NOTE:
It is a member-limited operation:
Only the authenticated members can access to this operation.
type Role ¶
type Role struct { Master bool `json:"-" bson:"master"` MemberManagement bool `json:"member_management" bson:"member_management"` ActivityManagement bool `json:"activity_management" bson:"activity_management"` FeeManagement bool `json:"fee_management" bson:"fee_management"` }
Role represents the member role.