Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
Isu Isu
Timestamp time.Time
IsSitting bool
IsDirty bool
IsOverweight bool
IsBroken bool
Message string
CreatedAt time.Time
}
func NewCondition ¶
func NewConditionFromLastCondition ¶
MEMO: random.baseTime を超えた時間が入る可能性がある
func (Condition) ConditionLevel ¶
func (c Condition) ConditionLevel() ConditionLevel
type ConditionLevel ¶
type ConditionLevel int
const ( ConditionLevelInfo ConditionLevel = 1 ConditionLevelWarning ConditionLevel = 2 ConditionLevelCritical ConditionLevel = 4 )
type Isu ¶
type Isu struct {
User User
JIAIsuUUID string
Name string
Image []byte
Character string
CharacterId int
CreatedAt time.Time
UpdatedAt time.Time
}
func NewIsuWithCharacterId ¶
func (*Isu) WithUpdateImage ¶
func (*Isu) WithUpdateName ¶
type IsuListById ¶
type IsuListById map[string]JsonIsuInfo
type Json ¶
type Json struct {
JiaUserId string `json:"jia_user_id"`
IsuListById IsuListById `json:"isu_list_by_id"`
}
type JsonCondition ¶
type JsonCondition struct {
Timestamp int64 `json:"timestamp"`
IsSitting bool `json:"is_sitting"`
IsDirty bool `json:"is_dirty"`
IsOverweight bool `json:"is_overweight"`
IsBroken bool `json:"is_broken"`
Message string `json:"message"`
CreatedAt time.Time `json:"created_at"`
ConditionLevel ConditionLevel `json:"condition_level"`
}
type JsonConditions ¶
type JsonConditions struct {
Info []JsonCondition `json:"info"`
Warning []JsonCondition `json:"warning"`
Critical []JsonCondition `json:"critical"`
}
func (*JsonConditions) AddCondition ¶
func (j *JsonConditions) AddCondition(condition Condition, isuId int) error
type JsonIsuInfo ¶
type JsonIsuInfo struct {
Id int `json:"id"`
Name string `json:"name"`
ImageFileHash [md5.Size]byte `json:"image_file_hash"`
Character string `json:"character"`
Conditions JsonConditions `json:"conditions"`
CreatedAt time.Time `json:"created_at"`
}
func ToJsonIsuInfo ¶
func ToJsonIsuInfo(id int, isu Isu, conditions JsonConditions) JsonIsuInfo
Click to show internal directories.
Click to hide internal directories.