Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigureJobManager(man *cereal.Manager, config *config.EventFeed) error
- func FromInternalFormatToList(entries []*feed.FeedEntry) ([]*event_feed.FeedEntry, error)
- type EventFeedServer
- func (eventFeedServer *EventFeedServer) EventExport(request *event_feed.EventExportRequest, ...) error
- func (eventFeedServer *EventFeedServer) GetFeed(ctx context.Context, request *event_feed.FeedRequest) (*event_feed.FeedResponse, error)
- func (eventFeedServer *EventFeedServer) GetFeedSummary(ctx context.Context, request *event_feed.FeedSummaryRequest) (*event_feed.FeedSummaryResponse, error)
- func (eventFeedServer *EventFeedServer) GetFeedTimeline(ctx context.Context, request *event_feed.FeedTimelineRequest) (*event_feed.FeedTimelineResponse, error)
- func (eventFeedServer *EventFeedServer) HandleEvent(ctx context.Context, request *automate_event.EventMsg) (*automate_event.EventResponse, error)
- func (eventFeedServer *EventFeedServer) Health() *health.Service
- type FeedService
- func (f *FeedService) GetActionLine(ctx context.Context, filters []string, startDate string, endDate string, ...) (*feed.ActionLine, error)
- func (f *FeedService) GetFeed(ctx context.Context, req *event_feed.FeedRequest) ([]*feed.FeedEntry, int64, error)
- func (f *FeedService) GetFeedSummary(ctx context.Context, countCategory string, filters []string, start time.Time, ...) (*feed.FeedSummary, error)
- func (f *FeedService) HandleEvent(req *api.EventMsg) (*api.EventResponse, error)
Constants ¶
const ( PurgeScheduleName = "periodic_purge" PurgeFeedPolicyName = "feed" PurgeFeedIndexName = persistence.IndexNameFeeds )
Variables ¶
var DefaultPurgePolicies = &purge.Policies{ Es: map[string]purge.EsPolicy{ PurgeFeedPolicyName: { Name: PurgeFeedPolicyName, IndexName: PurgeFeedIndexName, CustomPurgeField: "pub_timestamp", }, }, }
var PurgeWorkflowName = cereal.NewWorkflowName("purge")
Functions ¶
func ConfigureJobManager ¶
ConfigureJobManager migrates purge policies from the server event feed config and creates a scheduled workflow if it doesn't exist.
func FromInternalFormatToList ¶
func FromInternalFormatToList(entries []*feed.FeedEntry) ([]*event_feed.FeedEntry, error)
Types ¶
type EventFeedServer ¶
type EventFeedServer struct {
// contains filtered or unexported fields
}
EventFeedServer is the interface to this component.
func New ¶
func New(feedStore persistence.FeedStore) *EventFeedServer
New creates a new EventFeedServer instance.
func (*EventFeedServer) EventExport ¶
func (eventFeedServer *EventFeedServer) EventExport(request *event_feed.EventExportRequest, stream event_feed.EventFeedService_EventExportServer) error
EventExport downloading events report.
func (*EventFeedServer) GetFeed ¶
func (eventFeedServer *EventFeedServer) GetFeed(ctx context.Context, request *event_feed.FeedRequest) (*event_feed.FeedResponse, error)
TODO: @gcp refactor so that param validations & resulting grpc errors thrown here TODO: @gcp consistent behavior on err w/r/t returning either empty result set or nil
func (*EventFeedServer) GetFeedSummary ¶
func (eventFeedServer *EventFeedServer) GetFeedSummary(ctx context.Context, request *event_feed.FeedSummaryRequest) (*event_feed.FeedSummaryResponse, error)
func (*EventFeedServer) GetFeedTimeline ¶
func (eventFeedServer *EventFeedServer) GetFeedTimeline(ctx context.Context, request *event_feed.FeedTimelineRequest) (*event_feed.FeedTimelineResponse, error)
GetFeedTimeline - feed timeline consists of multiple lines, one for each type of action: create = 2 update = 1 delete = 0. This function gets the data for each line of the feed timeline (the "guitar strings" graph).
---------------------------------------------------------------------------- | Jan 28 | Jan 29 | Jan 30 | |_____________b__________|________________________|_____________i__________|'create' |________________________|_____________c__________|________________________|'update' |________________________|________________________|________________________|'delete' ----------------------------------------------------------------------------
func (*EventFeedServer) HandleEvent ¶
func (eventFeedServer *EventFeedServer) HandleEvent(ctx context.Context, request *automate_event.EventMsg) (*automate_event.EventResponse, error)
func (*EventFeedServer) Health ¶
func (eventFeedServer *EventFeedServer) Health() *health.Service
Health returns the servers embedded health check service
type FeedService ¶
type FeedService struct {
// contains filtered or unexported fields
}
func NewFeedService ¶
func NewFeedService(feedStore persistence.FeedStore) *FeedService
func (*FeedService) GetActionLine ¶
func (f *FeedService) GetActionLine(ctx context.Context, filters []string, startDate string, endDate string, timezone string, interval int, action string) (*feed.ActionLine, error)
interval = time span for which to collect activity entries in hours
func (*FeedService) GetFeed ¶
func (f *FeedService) GetFeed(ctx context.Context, req *event_feed.FeedRequest) ([]*feed.FeedEntry, int64, error)
func (*FeedService) GetFeedSummary ¶
func (*FeedService) HandleEvent ¶
func (f *FeedService) HandleEvent(req *api.EventMsg) (*api.EventResponse, error)
Going forward, we'll need to maintain a map of event types to feed type(s). Since the only events we support currently map to the "event" feed type, we're hard-coding the feed type below.