Documentation
¶
Index ¶
- func ExecuteDefaultSeeds(ctx context.Context, db *ent.Client) error
- func LogFromCtx(ctx context.Context) *slog.Logger
- func LogIntoCtx(ctx context.Context, logger *slog.Logger) context.Context
- func NewDatabaseConnection(input NewDatabaseConnectionInput) (*ent.Client, error)
- type AccessModel
- type Config
- type CreateAccessInput
- type CreateHistoryInput
- type CreateNotificationChannelInput
- type CreateScriptInput
- type CreateScriptStatsInput
- type CreateSecretInput
- type CreateUserInput
- type FrontendScriptBlobModel
- type FrontendScriptHistoryModel
- type HistoryModel
- type NewDatabaseConnectionInput
- type NewProjectInput
- type NewServerInput
- type NotificationChannelModel
- type ProjectModel
- type QueryHistoriesInput
- type Renderer
- type RunScriptInput
- type SMPTSettings
- type ScriptModel
- type ScriptStatsModel
- type SecretModel
- type Server
- type SessionData
- type SessionManager
- type SlackNotifyInput
- type UpdateHistoryInput
- type UpdateNotificationChannelInput
- type UpdateProjectInput
- type UpdateScriptInput
- type UpdateScriptStatsInput
- type UpdateSecretInput
- type UpdateUserInput
- type UserModel
- type WebhookNotificationPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogFromCtx ¶
LogFromCtx returns a Logger from a context. If no logger is found in the context, a new one is created using a default text handler.
func LogIntoCtx ¶
LogIntoCtx returns a new context with the given logger.
func NewDatabaseConnection ¶
func NewDatabaseConnection(input NewDatabaseConnectionInput) (*ent.Client, error)
Types ¶
type AccessModel ¶
type Config ¶
type CreateAccessInput ¶
type CreateHistoryInput ¶
type CreateNotificationChannelInput ¶
type CreateNotificationChannelInput struct { Name string Type string SlackConfig schema.SlackConfig EmailConfig schema.EmailConfig WebhookConfig schema.WebhookConfig Enabled bool }
type CreateScriptInput ¶
type CreateScriptStatsInput ¶
type CreateSecretInput ¶
type CreateUserInput ¶
type FrontendScriptBlobModel ¶
type FrontendScriptBlobModel struct {
Parameters []schema.ScriptInputOptions `json:"parameters"`
}
type FrontendScriptHistoryModel ¶
type FrontendScriptHistoryModel struct { HistoryModel ScriptName string ProjectID int ScriptID int }
type HistoryModel ¶
type HistoryModel struct { ID int `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ScriptID int `json:"script_id"` Trigger string `json:"trigger"` Success bool `json:"success"` TriggeredBy string `json:"triggered_by"` ExitCode int `json:"exit_code"` Duration int `json:"duration"` Output string `json:"output"` RunID string `json:"run_id"` Status string `json:"status"` Arguments map[string]string }
func (HistoryModel) FormatTime ¶
func (s HistoryModel) FormatTime() string
func (HistoryModel) HumanizeCreatedAt ¶
func (s HistoryModel) HumanizeCreatedAt() string
type NewProjectInput ¶
type NewServerInput ¶
type NotificationChannelModel ¶
type NotificationChannelModel struct { ID int `json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Name string `json:"name"` Type string `json:"type"` SlackConfig schema.SlackConfig `json:"slack_config"` EmailConfig schema.EmailConfig `json:"email_config"` WebhookConfig schema.WebhookConfig `json:"webhook_config"` Enabled bool `json:"enabled"` LastSendSuccessful *bool `json:"last_send_successful"` LastSend *time.Time `json:"last_send"` LastSendHuman string `json:"last_send_human"` HasBeenUsed bool `json:"has_been_used"` }
type ProjectModel ¶
type QueryHistoriesInput ¶
type RunScriptInput ¶
type RunScriptInput struct { Script ScriptModel Caller string Trigger string Args map[string]string ProjectID int ProjectName string SuccessChannel *NotificationChannelModel FailureChannel *NotificationChannelModel }
type SMPTSettings ¶
type ScriptModel ¶
type ScriptModel struct { ID int `json:"id"` Name string `json:"name"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Description string `json:"description"` ProjectID int `json:"project_id"` TimeoutSeconds int `json:"timeout_seconds"` Parameters []schema.ScriptInputOptions Script string `json:"script"` SuccessNotificationID *int `json:"success_notification_id"` FailureNotificationID *int `json:"failure_notification_id"` ScheduleEnabled bool `json:"schedule_enabled"` ScheduleCron string `json:"schedule_cron"` }
type ScriptStatsModel ¶
type ScriptStatsModel struct { ID int `json:"id"` ScriptID int `json:"script_id"` ProjectID int `json:"project_id"` TotalRuns int `json:"total_runs"` TotalSuccess int `json:"total_success"` TotalError int `json:"total_error"` AverageDuration int `json:"average_duration"` LastRun time.Time `json:"last_run"` LongestRun int `json:"longest_run"` ShortestRun int `json:"shortest_run"` TotalDuration int `json:"total_duration"` SuccessRate float64 `json:"success_rate"` }
func (*ScriptStatsModel) FormatTimeLastRun ¶
func (s *ScriptStatsModel) FormatTimeLastRun() string
func (*ScriptStatsModel) HumanizeLastRun ¶
func (s *ScriptStatsModel) HumanizeLastRun() string
type SecretModel ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(input NewServerInput) *Server
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionManager ¶
func NewSessionManager() *SessionManager
func (*SessionManager) CreateSession ¶
func (s *SessionManager) CreateSession(data SessionData) string
func (*SessionManager) DeleteSession ¶
func (s *SessionManager) DeleteSession(id string)
func (*SessionManager) GetSession ¶
func (s *SessionManager) GetSession(id string) (SessionData, error)
type SlackNotifyInput ¶
type UpdateHistoryInput ¶
type UpdateNotificationChannelInput ¶
type UpdateNotificationChannelInput struct { Name *string Type *string SlackConfig *schema.SlackConfig EmailConfig *schema.EmailConfig WebhookConfig *schema.WebhookConfig Enabled *bool LastUsed *time.Time LastUsedSuccess *bool }
type UpdateProjectInput ¶
type UpdateScriptInput ¶
type UpdateScriptStatsInput ¶
type UpdateSecretInput ¶
type UpdateUserInput ¶
type WebhookNotificationPayload ¶
type WebhookNotificationPayload struct { ProjectName string `json:"project_name"` ScriptName string `json:"script_name"` HistoryLink string `json:"history_link"` Success bool `json:"success"` TriggeredBy string `json:"triggered_by"` Trigger string `json:"trigger"` DurationSeconds int `json:"duration_seconds"` Arguments map[string]string `json:"arguments,omitempty"` RunID int `json:"run_id"` CreatedAt time.Time `json:"created_at"` }
Click to show internal directories.
Click to hide internal directories.