server

package
v0.0.0-...-f54f16c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PurgeScheduleName   = "periodic_purge"
	PurgeFeedPolicyName = "feed"
	PurgeFeedIndexName  = persistence.IndexNameFeeds
)

Variables

View Source
var DefaultPurgePolicies = &purge.Policies{
	Es: map[string]purge.EsPolicy{
		PurgeFeedPolicyName: {
			Name:             PurgeFeedPolicyName,
			IndexName:        PurgeFeedIndexName,
			CustomPurgeField: "pub_timestamp",
		},
	},
}
View Source
var PurgeWorkflowName = cereal.NewWorkflowName("purge")

Functions

func ConfigureJobManager

func ConfigureJobManager(man *cereal.Manager, config *config.EventFeed) error

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

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 (f *FeedService) GetFeedSummary(ctx context.Context, countCategory string, filters []string,
	start time.Time, end time.Time) (*feed.FeedSummary, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL