Added arn to the main repository

This commit is contained in:
2019-06-03 18:32:43 +09:00
parent cf258573a8
commit 29a48d94a5
465 changed files with 15968 additions and 288 deletions

21
arn/HasLocked.go Normal file
View File

@ -0,0 +1,21 @@
package arn
// HasLocked implements common like and unlike methods.
type hasLocked struct {
Locked bool `json:"locked"`
}
// Lock locks the object.
func (obj *hasLocked) Lock(userID UserID) {
obj.Locked = true
}
// Unlock unlocks the object.
func (obj *hasLocked) Unlock(userID UserID) {
obj.Locked = false
}
// IsLocked implements the Lockable interface.
func (obj *hasLocked) IsLocked() bool {
return obj.Locked
}