Documentation ¶
Index ¶
- Constants
- func EventTimeInfo(eventInfos []event.EventInfo) (firstTime, lastTime string)
- func Init()
- func SQLBuilder(filter Filter) string
- type CommentInfo
- type CreateInfo
- type Fault
- type FaultComment
- type FaultEvent
- type FaultFollower
- type FaultInfo
- type FaultStore
- func (fs *FaultStore) AddComment(faultid uint, creator, comment string) (FaultInfo, error)
- func (fs *FaultStore) AddEvent(faultid uint, eventids []uint) (FaultInfo, error)
- func (fs *FaultStore) AddTag(faultid uint, tags []string) (FaultInfo, error)
- func (fs *FaultStore) Create(createInfo CreateInfo) (FaultInfo, error)
- func (fs *FaultStore) DeleteComment(faultid uint, creator, comment string) (FaultInfo, error)
- func (fs *FaultStore) DeleteEvent(faultid uint, eventids []uint) (FaultInfo, error)
- func (fs *FaultStore) DeleteTag(faultid uint, tags []string) (FaultInfo, error)
- func (fs *FaultStore) FaultTimeInfo(faultid uint) (createdAt, closedAt time.Time, err error)
- func (fs *FaultStore) Get(id uint) (FaultInfo, error)
- func (fs *FaultStore) GetComment(faultid uint) ([]CommentInfo, error)
- func (fs *FaultStore) GetEvent(faultid uint) ([]event.EventInfo, error)
- func (fs *FaultStore) GetFaultBasic(faultid uint) (Fault, error)
- func (fs *FaultStore) GetFaultFollower(faultid uint) ([]string, error)
- func (fs *FaultStore) GetTag(faultid uint) ([]string, error)
- func (fs *FaultStore) GetTimeLine(faultid uint) (TimeLine, error)
- func (fs *FaultStore) List(filter Filter) ([]FaultInfo, uint, error)
- func (fs *FaultStore) UpdateBasic(faultid uint, title, note string) (FaultInfo, error)
- func (fs *FaultStore) UpdateFollower(faultid uint, follower []string, action string) (FaultInfo, error)
- func (fs *FaultStore) UpdateOwner(faultid uint, newOwner string) (FaultInfo, error)
- func (fs *FaultStore) UpdateState(faultid uint, newState string) (FaultInfo, error)
- type FaultTag
- type Filter
- type StateChangeLog
- type TimeLine
Constants ¶
View Source
const ( ActionFollow = "FOLLOW" // follow the fault ActionUnfollow = "UNFOLLOW" // unfollow the fault )
View Source
const ( StateUnprocessing = "UNPROCESSING" // state of fault StateProcessing = "PROCESSING" // state of fault StateClosed = "CLOSED" // state of fault StateDiscarded = "DISCARDED" // state of fault )
Variables ¶
This section is empty.
Functions ¶
func EventTimeInfo ¶
func SQLBuilder ¶
Types ¶
type CreateInfo ¶
type FaultComment ¶
type FaultComment struct { gorm.Model FaultId uint Creator string Comment string `gorm:"size:999"` }
func (FaultComment) TableName ¶
func (FaultComment) TableName() string
type FaultEvent ¶
type FaultEvent struct { gorm.Model FaultId uint `gorm:"unique_index:idx_faultid_eventid"` EventId uint `gorm:"unique_index:idx_faultid_eventid"` }
func (FaultEvent) TableName ¶
func (FaultEvent) TableName() string
type FaultFollower ¶
type FaultFollower struct { gorm.Model FaultId uint `gorm:"unique_index:idx_faultid_follower"` Follower string `gorm:"unique_index:idx_faultid_follower"` }
func (FaultFollower) TableName ¶
func (FaultFollower) TableName() string
type FaultStore ¶
var Store *FaultStore
Store contains db connection info of alarm-manager. See Init.
func NewFaultStore ¶
func NewFaultStore(db *gorm.DB) *FaultStore
func (*FaultStore) AddComment ¶
func (fs *FaultStore) AddComment(faultid uint, creator, comment string) ( FaultInfo, error)
func (*FaultStore) AddEvent ¶
func (fs *FaultStore) AddEvent(faultid uint, eventids []uint) (FaultInfo, error)
func (*FaultStore) AddTag ¶
func (fs *FaultStore) AddTag(faultid uint, tags []string) (FaultInfo, error)
func (*FaultStore) Create ¶
func (fs *FaultStore) Create(createInfo CreateInfo) (FaultInfo, error)
func (*FaultStore) DeleteComment ¶
func (fs *FaultStore) DeleteComment(faultid uint, creator, comment string) (FaultInfo, error)
func (*FaultStore) DeleteEvent ¶
func (fs *FaultStore) DeleteEvent(faultid uint, eventids []uint) ( FaultInfo, error)
func (*FaultStore) DeleteTag ¶
func (fs *FaultStore) DeleteTag(faultid uint, tags []string) ( FaultInfo, error)
func (*FaultStore) FaultTimeInfo ¶
func (fs *FaultStore) FaultTimeInfo(faultid uint) ( createdAt, closedAt time.Time, err error)
func (*FaultStore) GetComment ¶
func (fs *FaultStore) GetComment(faultid uint) ([]CommentInfo, error)
func (*FaultStore) GetEvent ¶
func (fs *FaultStore) GetEvent(faultid uint) ([]event.EventInfo, error)
func (*FaultStore) GetFaultBasic ¶
func (fs *FaultStore) GetFaultBasic(faultid uint) (Fault, error)
func (*FaultStore) GetFaultFollower ¶
func (fs *FaultStore) GetFaultFollower(faultid uint) ([]string, error)
func (*FaultStore) GetTimeLine ¶
func (fs *FaultStore) GetTimeLine(faultid uint) (TimeLine, error)
TODO: enrich the timeline of fault.
func (*FaultStore) UpdateBasic ¶
func (fs *FaultStore) UpdateBasic(faultid uint, title, note string) ( FaultInfo, error)
func (*FaultStore) UpdateFollower ¶
func (*FaultStore) UpdateOwner ¶
func (fs *FaultStore) UpdateOwner(faultid uint, newOwner string) ( FaultInfo, error)
func (*FaultStore) UpdateState ¶
func (fs *FaultStore) UpdateState(faultid uint, newState string) (FaultInfo, error)
type FaultTag ¶
Click to show internal directories.
Click to hide internal directories.