Documentation ¶
Index ¶
- func NewHistoryError(recordType RecordType, historyFile string) error
- type ApiHistoryItem
- type EventHistoryItem
- type EventRecord
- type History
- func (h *History) DeleteHistoryRecord(recordType RecordType) error
- func (h *History) ReadAllHistoryRecords() (*HistoryRecords, error)
- func (h *History) ReadHistoryRecords(recordType RecordType) ([]*HistoryRecord, error)
- func (h *History) WriteHistoryRecord(recordType RecordType, historyRecord *HistoryRecord) error
- type HistoryRecord
- type HistoryRecords
- type Param
- type RecordType
- type RequestHistory
- type ResponseHistory
- type TriggerType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHistoryError ¶
func NewHistoryError(recordType RecordType, historyFile string) error
Types ¶
type ApiHistoryItem ¶
type ApiHistoryItem struct { Api string `json:"api"` Request *RequestHistory `json:"request"` Response *ResponseHistory `json:"response"` }
type EventHistoryItem ¶
type EventHistoryItem struct { Event *EventRecord `json:"event,omitempty"` Payload string `json:"payload,omitempty"` }
type EventRecord ¶
type History ¶
type History struct {
ProjectDir string
}
func (*History) DeleteHistoryRecord ¶
func (h *History) DeleteHistoryRecord(recordType RecordType) error
func (*History) ReadAllHistoryRecords ¶
func (h *History) ReadAllHistoryRecords() (*HistoryRecords, error)
func (*History) ReadHistoryRecords ¶
func (h *History) ReadHistoryRecords(recordType RecordType) ([]*HistoryRecord, error)
func (*History) WriteHistoryRecord ¶
func (h *History) WriteHistoryRecord(recordType RecordType, historyRecord *HistoryRecord) error
type HistoryRecord ¶
type HistoryRecord struct { Time int64 `json:"time,omitempty"` Success bool `json:"success,omitempty"` EventHistoryItem ApiHistoryItem }
type HistoryRecords ¶
type HistoryRecords struct { ScheduleHistory []*HistoryRecord `json:"schedules"` TopicHistory []*HistoryRecord `json:"topics"` ApiHistory []*HistoryRecord `json:"apis"` }
type RecordType ¶
type RecordType string
const ( API RecordType = "apis" TOPIC RecordType = "topics" SCHEDULE RecordType = "schedules" )
type RequestHistory ¶
type RequestHistory struct { Method string `json:"method"` Path string `json:"path"` QueryParams []Param `json:"queryParams"` PathParams []Param `json:"pathParams"` Body []byte `json:"body"` Headers map[string][]string `json:"headers"` }
Only log what is required from req/resp to avoid massive log files
type ResponseHistory ¶
type TriggerType ¶
type TriggerType string
Click to show internal directories.
Click to hide internal directories.