Documentation
¶
Index ¶
Constants ¶
View Source
const BatchEventsURL = "/v1/event/batch"
BatchEventsURL post batch events
View Source
const EventCountryStatsURL = "/v1/event/stats/country"
EventCountryStatsURL stats per country
View Source
const EventURL = "/v1/event"
EventURL post single event
View Source
const StreamURL = "/v1/event/stream"
StreamURL websockets
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchEventResponse ¶
type BatchEventResponse struct { Duration time.Duration `json:"duration"` Rows int64 `json:"rows"` LastID int64 `json:"lastId"` }
BatchEventResponse response for batch inserts
type CountryStat ¶
CountryStat stats on cc
type Event ¶
type Event struct { ID int64 `json:"id"` Time EventTime `json:"time"` User string `json:"user"` Passwd string `json:"passwd"` RemoteAddr string `json:"remoteAddr"` RemoteGeoID int64 `json:"remoteGeoId"` RemotePort int `json:"remotePort"` RemoteName string `json:"remoteName"` RemoteVersion string `json:"remoteVersion"` OriginAddr string `json:"originAddr"` OriginGeoID int64 `json:"originGeoId"` Application string `json:"application"` Protocol string `json:"protocol"` }
Event to record
type EventClient ¶
type EventClient struct {
// contains filtered or unexported fields
}
EventClient hods the endpoint url
func New ¶
func New(server string, options ...func(*EventClient) error) (*EventClient, error)
New client for API
func (*EventClient) GetCountryStats ¶
func (e *EventClient) GetCountryStats() ([]CountryStat, error)
GetCountryStats country stats
func (*EventClient) GetEvent ¶
func (e *EventClient) GetEvent(id int64) (*EventGeo, error)
GetEvent TODO
func (*EventClient) RecordBatchEvents ¶
func (e *EventClient) RecordBatchEvents(events []Event) (BatchEventResponse, error)
RecordBatchEvents send compressed events
func (*EventClient) RecordEvent ¶
func (e *EventClient) RecordEvent(event Event) (int64, error)
RecordEvent send a single event
type EventGeo ¶
type EventGeo struct { ID int64 Time time.Time User string Passwd string RemoteAddr string RemotePort int RemoteName string RemoteVersion string RemoteCountry string RemoteCity string OriginAddr string OriginCountry string OriginCity string RemoteLatitude float64 RemoteLongitude float64 OriginLatitude float64 OriginLongitude float64 MetroCode uint }
EventGeo event with location
type EventTime ¶
EventTime Custom Serializer
func (EventTime) MarshalJSON ¶
func (*EventTime) UnmarshalJSON ¶
type ReadTransporter ¶
ReadTransporter for data
type RecordTransporter ¶
type RecordTransporter interface { RecordEvent(event Event) (int64, error) RecordBatchEvents(events []Event) (BatchEventResponse, error) }
RecordTransporter Methods to records password events
type Transporter ¶
type Transporter interface { ReadTransporter RecordTransporter }
Transporter for event Client
Click to show internal directories.
Click to hide internal directories.