Documentation ¶
Index ¶
Constants ¶
View Source
const AddRecordTopic = "history:addrecord"
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 {
// contains filtered or unexported fields
}
func NewHistory ¶ added in v1.33.1
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)
type HistoryRecord ¶
type HistoryRecord struct { Time int64 `json:"time,omitempty"` Success bool `json:"success,omitempty"` EventHistoryItem ApiHistoryItem RecordType RecordType `json:"-"` }
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.