Documentation ¶
Index ¶
- Constants
- func BuildMapStr(logEntry map[string]interface{}) common.MapStr
- func DeleteLogLife(filename string)
- type CloudflareClient
- type LogConsumer
- type Properties
- type RequestLogFile
- type StateFile
- func (s *StateFile) GetLastCount() int
- func (s *StateFile) GetLastEndTS() int
- func (s *StateFile) GetLastRequestTS() int
- func (s *StateFile) GetLastStartTS() int
- func (s *StateFile) Save() error
- func (s *StateFile) UpdateLastCount(count int)
- func (s *StateFile) UpdateLastEndTS(ts int)
- func (s *StateFile) UpdateLastRequestTS(ts int)
- func (s *StateFile) UpdateLastStartTS(ts int)
Constants ¶
View Source
const (
API_BASE = "https://api.cloudflare.com"
)
Variables ¶
This section is empty.
Functions ¶
func BuildMapStr ¶
BuildMapStr creates a valid common.MapStr struct only containing non-empty fields
func DeleteLogLife ¶
func DeleteLogLife(filename string)
Types ¶
type CloudflareClient ¶
type CloudflareClient struct { ApiKey string Email string UserServiceKey string RequestLogFile *RequestLogFile LogfileName string // contains filtered or unexported fields }
func NewClient ¶
func NewClient(params map[string]interface{}) *CloudflareClient
NewClient returns a new instance of a CloudflareClient struct
func (*CloudflareClient) GetLogRangeFromTimestamp ¶
func (c *CloudflareClient) GetLogRangeFromTimestamp(opts map[string]interface{}) (string, error)
type LogConsumer ¶
type LogConsumer struct { TotalLogFileSegments int LogFilesReady chan string EventsReady chan common.MapStr CompletedNotifier chan bool ProcessorTerminateSig chan bool WaitGroup sync.WaitGroup // contains filtered or unexported fields }
func NewLogConsumer ¶
func NewLogConsumer(cfEmail string, cfAPIKey string, numSegments int, eventBufferSize int, processors int) *LogConsumer
NewLogConsumer reutrns a instance of the LogConsumer struct
func (*LogConsumer) DownloadCurrentLogFiles ¶
func (lc *LogConsumer) DownloadCurrentLogFiles(zoneTag string, timeStart int, timeEnd int)
DownloadCurrentLogFiles downloads the log file segments from the Cloudflare ELS API
func (*LogConsumer) PrepareEvents ¶
func (lc *LogConsumer) PrepareEvents()
type Properties ¶
type Properties struct { LastStartTS int `json:"last_start_ts"` LastEndTS int `json:"last_end_ts"` LastCount int `json:"last_count"` LastRequestTS int `json:"last_request_ts"` LastUpdateTS int `json:"last_update_ts"` }
func (*Properties) ToJsonBytes ¶
func (p *Properties) ToJsonBytes() []byte
type RequestLogFile ¶
type RequestLogFile struct {
Filename string
}
func NewRequestLogFile ¶
func NewRequestLogFile(filename string) *RequestLogFile
func (*RequestLogFile) Destroy ¶
func (l *RequestLogFile) Destroy()
func (*RequestLogFile) SaveFromHttpResponseBody ¶
func (l *RequestLogFile) SaveFromHttpResponseBody(respBody *goreq.Body) (int64, error)
type StateFile ¶
type StateFile struct { FileName string FilePath string ZoneName string StorageType string // contains filtered or unexported fields }
func (*StateFile) GetLastCount ¶
func (*StateFile) GetLastEndTS ¶
func (*StateFile) GetLastRequestTS ¶
func (*StateFile) GetLastStartTS ¶
func (*StateFile) UpdateLastCount ¶
func (*StateFile) UpdateLastEndTS ¶
func (*StateFile) UpdateLastRequestTS ¶
func (*StateFile) UpdateLastStartTS ¶
Click to show internal directories.
Click to hide internal directories.