handlers

package
v0.0.0-...-8aeb8a1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 65 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogListener

func NewLogListener(destinationId string) *logListener

Types

type AirbyteDiscoverTask

type AirbyteDiscoverTask struct {
	// contains filtered or unexported fields
}

type AirbyteHandler

type AirbyteHandler struct {
	// contains filtered or unexported fields
}

func NewAirbyteHandler

func NewAirbyteHandler() *AirbyteHandler

func (*AirbyteHandler) CatalogHandler

func (ah *AirbyteHandler) CatalogHandler(c *gin.Context)

CatalogHandler returns airbyte catalog by docker name and config

func (*AirbyteHandler) SpecHandler

func (ah *AirbyteHandler) SpecHandler(c *gin.Context)

SpecHandler returns airbyte spec by docker name

func (*AirbyteHandler) VersionsHandler

func (ah *AirbyteHandler) VersionsHandler(c *gin.Context)

VersionsHandler requests available docker version from DockerHub and returns them by docker image name

type BulkHandler

type BulkHandler struct {
	// contains filtered or unexported fields
}

BulkHandler is used for accepting bulk events requests from server 2 server integrations (CLI)

func NewBulkHandler

func NewBulkHandler(destinationService *destinations.Service, processor events.Processor) *BulkHandler

NewBulkHandler returns configured BulkHandler

func (*BulkHandler) BulkLoadingHandler

func (bh *BulkHandler) BulkLoadingHandler(c *gin.Context)

BulkLoadingHandler loads file of events as one batch

type CachedEvent

type CachedEvent struct {
	Malformed     string          `json:"malformed,omitempty"`
	Original      json.RawMessage `json:"original,omitempty"`
	Success       json.RawMessage `json:"success,omitempty"`
	Error         string          `json:"error,omitempty"`
	Skip          string          `json:"skip,omitempty"`
	Timestamp     string          `json:"timestamp,omitempty"`
	UID           string          `json:"uid,omitempty"`
	DestinationID string          `json:"destination_id"`
	TokenID       string          `json:"token_id"`
}

CachedEvent is a dto for events cache

type CachedEventsResponse

type CachedEventsResponse struct {
	TotalEvents              int           `json:"total_events"`
	LastMinuteLimited        uint64        `json:"last_minute_limited"`
	CacheCapacityPerInterval int           `json:"cache_capacity_per_interval"`
	IntervalSeconds          int           `json:"interval_seconds"`
	ResponseEvents           int           `json:"response_events"`
	Events                   []CachedEvent `json:"events"`
}

CachedEventsResponse dto for events cache response

type CatalogResponse

type CatalogResponse struct {
	middleware.StatusResponse

	Catalog interface{} `json:"catalog"`
}

type ClearCacheRequest

type ClearCacheRequest struct {
	Source     string `json:"source"`
	Collection string `json:"collection"`
}

ClearCacheRequest is a dto for ClearCache endpoint

type ClusterHandler

type ClusterHandler struct {
	// contains filtered or unexported fields
}

ClusterHandler handles cluster info requests

func NewClusterHandler

func NewClusterHandler(coordinationService *coordination.Service) *ClusterHandler

NewClusterHandler returns configured ClusterHandler instance

func (*ClusterHandler) Handler

func (ch *ClusterHandler) Handler(c *gin.Context)

Handler returns all jitsu server instances names from current cluster

type ClusterInfo

type ClusterInfo struct {
	Instances []InstanceInfo `json:"instances"`
}

ClusterInfo is a dto for Cluster info response

type DestinationsHandler

type DestinationsHandler struct {
	// contains filtered or unexported fields
}

func NewDestinationsHandler

func NewDestinationsHandler(userRecognition *config.UsersRecognition) *DestinationsHandler

func (*DestinationsHandler) Handler

func (dh *DestinationsHandler) Handler(c *gin.Context)

type DockerHubResponse

type DockerHubResponse struct {
	Next    string          `json:"next"`
	Results []*DockerHubTag `json:"results"`
}

DockerHubResponse is a DockerHub tags response dto

type DockerHubTag

type DockerHubTag struct {
	Name          string `json:"name"`
	TagLastPushed string `json:"tag_last_pushed"`
}

DockerHubTag is a DockerHub tags dto

type DryRunHandler

type DryRunHandler struct {
	// contains filtered or unexported fields
}

func NewDryRunHandler

func NewDryRunHandler(destinationService *destinations.Service, preprocessor events.Processor,
	geoService *geo.Service) *DryRunHandler

func (*DryRunHandler) Handle

func (drh *DryRunHandler) Handle(c *gin.Context)

type EvaluateLog

type EvaluateLog struct {
	Level   string `json:"level"`
	Message string `json:"message"`
}

type EvaluateTemplateRequest

type EvaluateTemplateRequest struct {
	Config            map[string]interface{} `json:"config,omitempty"`
	Object            map[string]interface{} `json:"object,omitempty"`
	Expression        string                 `json:"expression,omitempty"`
	Reformat          bool                   `json:"reformat,omitempty"`
	Type              string                 `json:"type,omitempty"`
	Uid               string                 `json:"uid,omitempty"`
	Field             string                 `json:"field,omitempty"`
	TemplateVariables map[string]interface{} `json:"template_variables,omitempty"`
}

EvaluateTemplateRequest is a request dto for testing text/template expressions

func (*EvaluateTemplateRequest) TemplateFunctions

func (etr *EvaluateTemplateRequest) TemplateFunctions() template.FuncMap

TemplateFunctions fills template functions with destination data from request

func (*EvaluateTemplateRequest) Validate

func (etr *EvaluateTemplateRequest) Validate() error

Validate returns err if invalid

type EvaluateTemplateResponse

type EvaluateTemplateResponse struct {
	Result     string        `json:"result"`
	Logs       []EvaluateLog `json:"logs,omitempty"`
	Error      string        `json:"error"`
	UserResult string        `json:"user_result"`
	UserError  string        `json:"user_error"`
	Format     string        `json:"format"`
}

EvaluateTemplateResponse is a response dto for testing text/template expressions

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

EventHandler accepts all events

func NewEventHandler

func NewEventHandler(writeAheadLogService *wal.Service, multiplexingService *multiplexing.Service,
	eventsCache *caching.EventsCache, parser events.Parser, processor events.Processor, destinationService *destinations.Service,
	geoService *geo.Service) (eventHandler *EventHandler)

NewEventHandler returns configured EventHandler

func (*EventHandler) CacheRawEvents

func (eh *EventHandler) CacheRawEvents(eventsArray []events.Event, cachingDisabled bool, tokenID string, skip error, err error)

func (*EventHandler) GetHandler

func (eh *EventHandler) GetHandler(c *gin.Context)

GetHandler returns cached events by destination_ids

func (*EventHandler) PostHandler

func (eh *EventHandler) PostHandler(c *gin.Context)

PostHandler accepts all events according to token

type EventResponse

type EventResponse struct {
	Status       string                   `json:"status"`
	DeleteCookie bool                     `json:"delete_cookie,omitempty"`
	SdkExtras    []map[string]interface{} `json:"jitsu_sdk_extras,omitempty"`
}

EventResponse is a dto for sending operation status and delete_cookie flag

type EventTemplateHandler

type EventTemplateHandler struct {
	// contains filtered or unexported fields
}

EventTemplateHandler is a handler for testing text/template expression with income object

func NewEventTemplateHandler

func NewEventTemplateHandler(factory storages.Factory) *EventTemplateHandler

func (*EventTemplateHandler) Handler

func (h *EventTemplateHandler) Handler(c *gin.Context)

type FallbackFilesResponse

type FallbackFilesResponse struct {
	Files []*fallback.FileStatus `json:"files"`
}

type FallbackHandler

type FallbackHandler struct {
	// contains filtered or unexported fields
}

func NewFallbackHandler

func NewFallbackHandler(fallbackService *fallback.Service) *FallbackHandler

func (*FallbackHandler) GetHandler

func (fh *FallbackHandler) GetHandler(c *gin.Context)

func (*FallbackHandler) ReplayHandler

func (fh *FallbackHandler) ReplayHandler(c *gin.Context)

type GeoDataResolverHandler

type GeoDataResolverHandler struct {
	// contains filtered or unexported fields
}

GeoDataResolverHandler is responsible for testing maxmind connection

func NewGeoDataResolverHandler

func NewGeoDataResolverHandler(service *geo.Service) *GeoDataResolverHandler

NewGeoDataResolverHandler returns configured handler

func (*GeoDataResolverHandler) EditionsHandler

func (gdrh *GeoDataResolverHandler) EditionsHandler(c *gin.Context)

EditionsHandler returns all supported geo data resolvers editions

func (*GeoDataResolverHandler) TestHandler

func (gdrh *GeoDataResolverHandler) TestHandler(c *gin.Context)

TestHandler validates geo data resolver connection

type GeoDataResolverTestRequest

type GeoDataResolverTestRequest struct {
	MaxMindURL string `json:"maxmind_url"`
}

GeoDataResolverTestRequest is a dto for test endpoint request

type GeoDataResolverTestResponse

type GeoDataResolverTestResponse struct {
	middleware.StatusResponse

	Editions []*geo.EditionRule `json:"editions"`
}

GeoDataResolverTestResponse is a dto for test endpoint response

type InstanceInfo

type InstanceInfo struct {
	Name string `json:"name"`
}

InstanceInfo is a dto for server name

type PixelHandler

type PixelHandler struct {
	// contains filtered or unexported fields
}

PixelHandler is a handler of pixel tracking requests

func NewPixelHandler

func NewPixelHandler(multiplexingService *multiplexing.Service, processor events.Processor,
	destinationService *destinations.Service, geoService *geo.Service) *PixelHandler

NewPixelHandler returns configured PixelHandler instance

func (*PixelHandler) Handle

func (ph *PixelHandler) Handle(c *gin.Context)

Handle sets anonymous id cookie if not exist handles request it it another goroutine returns empty gif 1x1

type RedirectHandler

type RedirectHandler struct {
	// contains filtered or unexported fields
}

RedirectHandler handles redirects 1 handler per 1 URL

func NewRedirectHandler

func NewRedirectHandler(redirectToURL string) *RedirectHandler

NewRedirectHandler returns RedirectHandler instance

func (*RedirectHandler) Handler

func (rh *RedirectHandler) Handler(c *gin.Context)

Handler writes HTTP 308 with toURL

type ReplayRequest

type ReplayRequest struct {
	FileName      string `json:"file_name"`
	DestinationID string `json:"destination_id"`
	FileFormat    string `json:"file_format"`
	SkipMalformed bool   `json:"skip_malformed"`
}

type RootPathHandler

type RootPathHandler struct {
	// contains filtered or unexported fields
}

RootPathHandler serves: HTTP redirect to Configurator HTML Welcome page or blanc page

func NewRootPathHandler

func NewRootPathHandler(service *system.Service, sourceDir, configuratorURN string, disableWelcomePage, redirectToHttps, disableSignature, alwaysRedirectToConfigurator bool) *RootPathHandler

NewRootPathHandler reads sourceDir and returns RootPathHandler instance

func (*RootPathHandler) Handler

func (rph *RootPathHandler) Handler(c *gin.Context)

Handler handles requests and returns welcome page or redirect to Configurator URL

type SdkSourceHandler

type SdkSourceHandler struct {
	// contains filtered or unexported fields
}

func NewSdkSourceHandler

func NewSdkSourceHandler() *SdkSourceHandler

func (*SdkSourceHandler) CatalogHandler

func (ah *SdkSourceHandler) CatalogHandler(c *gin.Context)

CatalogHandler returns sdk source catalog by package_name@version and config

func (*SdkSourceHandler) SpecHandler

func (ah *SdkSourceHandler) SpecHandler(c *gin.Context)

SpecHandler returns sdk source spec by package name (with version)

type SingerHandler

type SingerHandler struct {
}

func NewSingerHandler

func NewSingerHandler() *SingerHandler

func (*SingerHandler) CatalogHandler

func (sh *SingerHandler) CatalogHandler(c *gin.Context)

type SourcesHandler

type SourcesHandler struct {
	// contains filtered or unexported fields
}

SourcesHandler is used for testing sources connection and clean sync cache

func NewSourcesHandler

func NewSourcesHandler(sourcesService *sources.Service, metaStorage meta.Storage, destinations *destinations.Service) *SourcesHandler

NewSourcesHandler returns configured SourcesHandler instance

func (*SourcesHandler) ClearCacheHandler

func (sh *SourcesHandler) ClearCacheHandler(c *gin.Context)

ClearCacheHandler deletes source state (signature) from meta.Storage

func (*SourcesHandler) OauthFields

func (sh *SourcesHandler) OauthFields(c *gin.Context)

OauthFields returns object with source config field that can be preconfigured on server side. Along with info what env pr yaml path need to configure field and current status (provided on server side or not)

func (*SourcesHandler) TestSourcesHandler

func (sh *SourcesHandler) TestSourcesHandler(c *gin.Context)

TestSourcesHandler tests source connection returns:

200 with status ok if a connection is ok
200 with status pending if source isn't ready
200 with status pending and error in body if source isn't ready and has previous error
400 with error if a connection failed

type SpecResponse

type SpecResponse struct {
	middleware.StatusResponse

	Spec interface{} `json:"spec"`
}

type StaticHandler

type StaticHandler struct {
	// contains filtered or unexported fields
}

StaticHandler serves js files

func NewStaticHandler

func NewStaticHandler(sourceDir, serverPublicURL string) *StaticHandler

func (*StaticHandler) Handler

func (sh *StaticHandler) Handler(c *gin.Context)

type StatisticsHandler

type StatisticsHandler struct {
	// contains filtered or unexported fields
}

func NewStatisticsHandler

func NewStatisticsHandler(metaStorage meta.Storage) *StatisticsHandler

func (*StatisticsHandler) DeprecatedGetHandler

func (sh *StatisticsHandler) DeprecatedGetHandler(c *gin.Context)

536-issue DEPRECATED

func (*StatisticsHandler) GetHandler

func (sh *StatisticsHandler) GetHandler(c *gin.Context)

type StatisticsResponse

type StatisticsResponse struct {
	Status string               `json:"status"`
	Data   []meta.EventsPerTime `json:"data"`
}

type TaskHandler

type TaskHandler struct {
	// contains filtered or unexported fields
}

func NewTaskHandler

func NewTaskHandler(taskService *synchronization.TaskService, sourceService *sources.Service) *TaskHandler

func (*TaskHandler) GetAllHandler

func (sh *TaskHandler) GetAllHandler(c *gin.Context)

func (*TaskHandler) GetByIDHandler

func (sh *TaskHandler) GetByIDHandler(c *gin.Context)

func (*TaskHandler) SyncHandler

func (sh *TaskHandler) SyncHandler(c *gin.Context)

func (*TaskHandler) TaskCancelHandler

func (sh *TaskHandler) TaskCancelHandler(c *gin.Context)

func (*TaskHandler) TaskLogsHandler

func (sh *TaskHandler) TaskLogsHandler(c *gin.Context)

type TaskIDResponse

type TaskIDResponse struct {
	ID string `json:"task_id"`
}

type TaskLogsResponse

type TaskLogsResponse struct {
	Logs []synchronization.LogRecordDto `json:"logs"`
}

type TasksResponse

type TasksResponse struct {
	Tasks []synchronization.TaskDto `json:"tasks"`
}

type VersionsResponse

type VersionsResponse struct {
	Versions []string `json:"versions"`
}

Jump to

Keyboard shortcuts

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