service

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Create          action = "CREATE"
	Get             action = "GET"
	GetRun          action = "GET_RUNS"
	Delete          action = "DELETE"
	GetAppSchedule  action = "GET_APP_SCHEDULES"
	Reconcile       action = "RECONCILE"
	GetCronSchedule action = "GET_CRON_SCHEDULE"
)
View Source
const MaxBulkActionPeriodInDays = 7

Variables

This section is empty.

Functions

func HealthCheck

func HealthCheck(w http.ResponseWriter, r *http.Request)

Types

type AllScheduleResponse

type AllScheduleResponse struct {
	Schedule []s.Schedule `json:"schdeules"`
}

type BulkActionResponse

type BulkActionResponse struct {
	Status  Status `json:"status"`
	Remarks string `json:"remarks"`
}

type CreateAppData

type CreateAppData struct {
	AppId         string          `json:"appId"`
	Partitions    uint32          `json:"partitions"`
	Active        bool            `json:"active"`
	Configuration s.Configuration `json:"configuration"`
}

type CreateAppResponse

type CreateAppResponse struct {
	Status Status        `json:"status"`
	Data   CreateAppData `json:"data"`
}

type CreateConfigurationData

type CreateConfigurationData struct {
	AppId         string          `json:"appId"`
	Configuration s.Configuration `json:"configuration"`
}

type CreateConfigurationResponse

type CreateConfigurationResponse struct {
	Status Status                  `json:"status"`
	Data   CreateConfigurationData `json:"data"`
}

type CreateScheduleData

type CreateScheduleData struct {
	Schedule s.Schedule `json:"schedule"`
}

type CreateScheduleResponse

type CreateScheduleResponse struct {
	Status Status             `json:"status"`
	Data   CreateScheduleData `json:"data"`
}

type DeleteConfigurationData

type DeleteConfigurationData struct {
	AppId         string          `json:"appId"`
	Configuration s.Configuration `json:"configuration"`
}

type DeleteConfigurationResponse

type DeleteConfigurationResponse struct {
	Status Status                  `json:"status"`
	Data   DeleteConfigurationData `json:"data"`
}

type DeleteScheduleData

type DeleteScheduleData struct {
	Schedule s.Schedule `json:"schedule"`
}

type DeleteScheduleResponse

type DeleteScheduleResponse struct {
	Status Status             `json:"status"`
	Data   DeleteScheduleData `json:"data"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []string `json:"errors"`
}

type GetAppSchedulesData

type GetAppSchedulesData struct {
	Schedules []s.Schedule `json:"schedules"`
}

type GetAppSchedulesResponse

type GetAppSchedulesResponse struct {
	Status Status              `json:"status"`
	Data   GetAppSchedulesData `json:"data"`
}

type GetAppsData

type GetAppsData struct {
	Apps []s.App `json:"apps"`
}

type GetAppsResponse

type GetAppsResponse struct {
	Status Status      `json:"status"`
	Data   GetAppsData `json:"data"`
}

type GetConfigurationData

type GetConfigurationData struct {
	AppId         string          `json:"appId"`
	Configuration s.Configuration `json:"configuration"`
}

type GetConfigurationResponse

type GetConfigurationResponse struct {
	Status Status               `json:"status"`
	Data   GetConfigurationData `json:"data"`
}

type GetCronSchedulesResponse

type GetCronSchedulesResponse struct {
	Status Status       `json:"status"`
	Data   []s.Schedule `json:"data"`
}

type GetPaginatedAppSchedulesData

type GetPaginatedAppSchedulesData struct {
	Schedules             []s.Schedule `json:"schedules"`
	ContinuationToken     string       `json:"continuationToken"`
	ContinuationStartTime int64        `json:"continuationStartTime"`
}

type GetPaginatedAppSchedulesResponse

type GetPaginatedAppSchedulesResponse struct {
	Status Status                       `json:"status"`
	Data   GetPaginatedAppSchedulesData `json:"data"`
}

type GetPaginatedRunSchedulesData

type GetPaginatedRunSchedulesData struct {
	Schedules         []s.Schedule `json:"schedules"`
	ContinuationToken string       `json:"continuationToken"`
}

type GetPaginatedRunSchedulesResponse

type GetPaginatedRunSchedulesResponse struct {
	Status Status                       `json:"status"`
	Data   GetPaginatedRunSchedulesData `json:"data"`
}

type GetScheduleData

type GetScheduleData struct {
	Schedule s.Schedule `json:"schedule"`
}

type GetScheduleResponse

type GetScheduleResponse struct {
	Status Status          `json:"status"`
	Data   GetScheduleData `json:"data"`
}

type GetScheduleRunsData

type GetScheduleRunsData struct {
	Schedules []s.Schedule `json:"schedules"`
}

type GetScheduleRunsResponse

type GetScheduleRunsResponse struct {
	Status Status              `json:"status"`
	Data   GetScheduleRunsData `json:"data"`
}

type HealthCheckResponse

type HealthCheckResponse struct {
	Status string `json:"status"`
	Code   int    `json:"code"`
}

type NewScheduleResponse

type NewScheduleResponse struct {
	ScheduleId gocql.UUID `json:"scheduleid"`
}

type Service

type Service struct {
	Config      *c.Configuration
	Supervisor  cluster.SupervisorHandler
	ClusterDao  dao.ClusterDao
	ScheduleDao dao.ScheduleDao
	Monitor     monitoring.Monitor
}

func NewService

func NewService(config *c.Configuration, supervisor cluster.SupervisorHandler, clusterDao dao.ClusterDao, scheduleDAO dao.ScheduleDao, monitor monitoring.Monitor) *Service

func (*Service) Activate

func (s *Service) Activate(w http.ResponseWriter, r *http.Request)

func (*Service) ActivateApp

func (s *Service) ActivateApp(appId string) error

func (*Service) BulkAction

func (s *Service) BulkAction(w http.ResponseWriter, r *http.Request)

func (*Service) CancelSchedule

func (s *Service) CancelSchedule(w http.ResponseWriter, r *http.Request)

func (*Service) CreateConfiguration

func (s *Service) CreateConfiguration(w http.ResponseWriter, r *http.Request)

func (*Service) CreateSchedule

func (s *Service) CreateSchedule(input sch.Schedule) (sch.Schedule, error)

CreateSchedule createSchedule creates a new schedule

func (*Service) Deactivate

func (s *Service) Deactivate(w http.ResponseWriter, r *http.Request)

func (*Service) DeactivateApp

func (s *Service) DeactivateApp(appId string) error

func (*Service) DeleteConfiguration

func (s *Service) DeleteConfiguration(w http.ResponseWriter, r *http.Request)

func (*Service) DeleteSchedule

func (s *Service) DeleteSchedule(uuid string) (sch.Schedule, error)

func (*Service) ExecuteBulkAction

func (s *Service) ExecuteBulkAction(appId string, action store.ActionType, status store.Status, timeRange dao.Range) error

func (*Service) FetchAppSchedules

func (s *Service) FetchAppSchedules(appId string, timeRange dao.Range, size int64, status sch.Status, pageState []byte, continuationStartTime time.Time) ([]sch.Schedule, []byte, time.Time, error)

func (*Service) FetchApps

func (s *Service) FetchApps(appId string) ([]store.App, error)

func (*Service) FetchCronRuns

func (s *Service) FetchCronRuns(uuid string, size int64, when string, pageState []byte) ([]sch.Schedule, []byte, error)

func (*Service) FetchCronSchedules

func (s *Service) FetchCronSchedules(appId string, status sch.Status) ([]sch.Schedule, error)

func (*Service) Get

func (s *Service) Get(w http.ResponseWriter, r *http.Request)

func (*Service) GetAppSchedules

func (s *Service) GetAppSchedules(w http.ResponseWriter, r *http.Request)

get all the schedules of an app based on time range and status

func (*Service) GetApps

func (s *Service) GetApps(w http.ResponseWriter, r *http.Request)

func (*Service) GetConfiguration

func (s *Service) GetConfiguration(w http.ResponseWriter, r *http.Request)

func (*Service) GetCronSchedules

func (s *Service) GetCronSchedules(w http.ResponseWriter, r *http.Request)

func (*Service) GetRuns

func (s *Service) GetRuns(w http.ResponseWriter, r *http.Request)

func (*Service) GetSchedule

func (s *Service) GetSchedule(uuid string) (sch.Schedule, error)

func (*Service) Post

func (s *Service) Post(w http.ResponseWriter, r *http.Request)

func (*Service) Register

func (s *Service) Register(w http.ResponseWriter, r *http.Request)

func (*Service) RegisterApp

func (s *Service) RegisterApp(input store.App) (store.App, error)

func (*Service) UpdateConfiguration

func (s *Service) UpdateConfiguration(w http.ResponseWriter, r *http.Request)

type Status

type Status struct {
	StatusCode    int    `json:"statusCode"`
	StatusMessage string `json:"statusMessage"`
	StatusType    string `json:"statusType"`
	TotalCount    int    `json:"totalCount"`
}

type UpdateAppActiveStatusData

type UpdateAppActiveStatusData struct {
	AppId  string `json:"appId"`
	Active bool   `json:"Active"`
}

type UpdateAppActiveStatusResponse

type UpdateAppActiveStatusResponse struct {
	Status Status                    `json:"status"`
	Data   UpdateAppActiveStatusData `json:"data"`
}

type UpdateConfigurationData

type UpdateConfigurationData struct {
	AppId         string          `json:"appId"`
	Configuration s.Configuration `json:"configuration"`
}

type UpdateConfigurationResponse

type UpdateConfigurationResponse struct {
	Status Status                  `json:"status"`
	Data   UpdateConfigurationData `json:"data"`
}

Jump to

Keyboard shortcuts

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