forms

package
v1.17.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidForm = errors.New("invalid form")
)

Functions

func ReadAndValidate

func ReadAndValidate(r *http.Request, f Form) error

Types

type ApiKeyForm added in v1.7.0

type ApiKeyForm struct {
	Action string `json:"action"`
	db.ApiKey
}

func (*ApiKeyForm) Valid added in v1.7.0

func (f *ApiKeyForm) Valid() bool

type ApplicationCategoryForm

type ApplicationCategoryForm struct {
	Action string                    `json:"action"`
	Id     model.ApplicationCategory `json:"id"`
	db.ApplicationCategory
	Test *struct {
		Incident   *db.ApplicationCategoryNotificationDestinations `json:"incident,omitempty"`
		Deployment *db.ApplicationCategoryNotificationDestinations `json:"deployment,omitempty"`
	} `json:"test,omitempty"`
}

func (*ApplicationCategoryForm) SendTestNotification added in v1.10.0

func (f *ApplicationCategoryForm) SendTestNotification(ctx context.Context, project *db.Project) error

func (*ApplicationCategoryForm) Valid

func (f *ApplicationCategoryForm) Valid() bool

type ApplicationInstrumentationForm added in v1.3.0

type ApplicationInstrumentationForm struct {
	model.ApplicationInstrumentation
}

func (*ApplicationInstrumentationForm) Valid added in v1.3.0

type ApplicationSettingsLogsForm added in v0.20.0

type ApplicationSettingsLogsForm struct {
	model.ApplicationSettingsLogs
}

func (*ApplicationSettingsLogsForm) Valid added in v0.20.0

func (f *ApplicationSettingsLogsForm) Valid() bool

type ApplicationSettingsProfilingForm added in v0.27.0

type ApplicationSettingsProfilingForm struct {
	model.ApplicationSettingsProfiling
}

func (*ApplicationSettingsProfilingForm) Valid added in v0.27.0

type ApplicationSettingsRisksForm added in v1.8.0

type ApplicationSettingsRisksForm struct {
	Action string        `json:"action"`
	Key    model.RiskKey `json:"key"`
	Reason string        `json:"reason"`
}

func (*ApplicationSettingsRisksForm) Valid added in v1.8.0

type ApplicationSettingsTracingForm

type ApplicationSettingsTracingForm struct {
	model.ApplicationSettingsTracing
}

func (*ApplicationSettingsTracingForm) Valid

type ChangePasswordForm added in v1.5.0

type ChangePasswordForm struct {
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

func (*ChangePasswordForm) Valid added in v1.5.0

func (f *ChangePasswordForm) Valid() bool

type CheckConfigForm

type CheckConfigForm struct {
	Configs []*model.CheckConfigSimple `json:"configs"`
}

func (*CheckConfigForm) Valid

func (f *CheckConfigForm) Valid() bool

type CheckConfigSLOAvailabilityForm

type CheckConfigSLOAvailabilityForm struct {
	Configs []model.CheckConfigSLOAvailability `json:"configs"`
	Default bool                               `json:"default"`
}

func (*CheckConfigSLOAvailabilityForm) Valid

type CheckConfigSLOLatencyForm

type CheckConfigSLOLatencyForm struct {
	Configs []model.CheckConfigSLOLatency `json:"configs"`
	Default bool                          `json:"default"`
}

func (*CheckConfigSLOLatencyForm) Valid

func (f *CheckConfigSLOLatencyForm) Valid() bool

type CustomApplicationForm added in v1.4.0

type CustomApplicationForm struct {
	Name    string `json:"name"`
	NewName string `json:"new_name"`

	InstancePatternsStr string `json:"instance_patterns"`
	InstancePatterns    []string
}

func (*CustomApplicationForm) Valid added in v1.4.0

func (f *CustomApplicationForm) Valid() bool

type CustomCloudPricingForm added in v1.11.0

type CustomCloudPricingForm struct {
	db.CustomCloudPricing
}

func (*CustomCloudPricingForm) Valid added in v1.11.0

func (f *CustomCloudPricingForm) Valid() bool

type DashboardForm added in v1.12.0

type DashboardForm struct {
	Action string `json:"action"`
	db.Dashboard
}

func (*DashboardForm) Valid added in v1.12.0

func (f *DashboardForm) Valid() bool

type Form

type Form interface {
	Valid() bool
}

type IntegrationForm

type IntegrationForm interface {
	Form
	Get(project *db.Project, masked bool)
	Update(ctx context.Context, project *db.Project, clear bool) error
	Test(ctx context.Context, project *db.Project) error
}

func NewIntegrationForm

func NewIntegrationForm(t db.IntegrationType, globalClickHouse *db.IntegrationClickhouse, globalPrometheus *db.IntegrationPrometheus) IntegrationForm

type IntegrationFormAWS added in v1.3.0

type IntegrationFormAWS struct {
	db.IntegrationAWS
}

func (*IntegrationFormAWS) Get added in v1.3.0

func (f *IntegrationFormAWS) Get(project *db.Project, masked bool)

func (*IntegrationFormAWS) Test added in v1.3.0

func (f *IntegrationFormAWS) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormAWS) Update added in v1.3.0

func (f *IntegrationFormAWS) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormAWS) Valid added in v1.3.0

func (f *IntegrationFormAWS) Valid() bool

type IntegrationFormClickhouse

type IntegrationFormClickhouse struct {
	db.IntegrationClickhouse
	// contains filtered or unexported fields
}

func (*IntegrationFormClickhouse) Get

func (f *IntegrationFormClickhouse) Get(project *db.Project, masked bool)

func (*IntegrationFormClickhouse) Test

func (f *IntegrationFormClickhouse) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormClickhouse) Update

func (f *IntegrationFormClickhouse) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormClickhouse) Valid

func (f *IntegrationFormClickhouse) Valid() bool

type IntegrationFormOpsgenie

type IntegrationFormOpsgenie struct {
	db.IntegrationOpsgenie
}

func (*IntegrationFormOpsgenie) Get

func (f *IntegrationFormOpsgenie) Get(project *db.Project, masked bool)

func (*IntegrationFormOpsgenie) Test

func (f *IntegrationFormOpsgenie) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormOpsgenie) Update

func (f *IntegrationFormOpsgenie) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormOpsgenie) Valid

func (f *IntegrationFormOpsgenie) Valid() bool

type IntegrationFormPagerduty

type IntegrationFormPagerduty struct {
	db.IntegrationPagerduty
}

func (*IntegrationFormPagerduty) Get

func (f *IntegrationFormPagerduty) Get(project *db.Project, masked bool)

func (*IntegrationFormPagerduty) Test

func (f *IntegrationFormPagerduty) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormPagerduty) Update

func (f *IntegrationFormPagerduty) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormPagerduty) Valid

func (f *IntegrationFormPagerduty) Valid() bool

type IntegrationFormPrometheus

type IntegrationFormPrometheus struct {
	db.IntegrationPrometheus
	// contains filtered or unexported fields
}

func (*IntegrationFormPrometheus) Get

func (f *IntegrationFormPrometheus) Get(project *db.Project, masked bool)

func (*IntegrationFormPrometheus) Test

func (f *IntegrationFormPrometheus) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormPrometheus) Update

func (f *IntegrationFormPrometheus) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormPrometheus) Valid

func (f *IntegrationFormPrometheus) Valid() bool

type IntegrationFormSlack

type IntegrationFormSlack struct {
	db.IntegrationSlack
}

func (*IntegrationFormSlack) Get

func (f *IntegrationFormSlack) Get(project *db.Project, masked bool)

func (*IntegrationFormSlack) Test

func (f *IntegrationFormSlack) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormSlack) Update

func (f *IntegrationFormSlack) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormSlack) Valid

func (f *IntegrationFormSlack) Valid() bool

type IntegrationFormTeams

type IntegrationFormTeams struct {
	db.IntegrationTeams
}

func (*IntegrationFormTeams) Get

func (f *IntegrationFormTeams) Get(project *db.Project, masked bool)

func (*IntegrationFormTeams) Test

func (f *IntegrationFormTeams) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormTeams) Update

func (f *IntegrationFormTeams) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormTeams) Valid

func (f *IntegrationFormTeams) Valid() bool

type IntegrationFormWebhook added in v1.0.0

type IntegrationFormWebhook struct {
	db.IntegrationWebhook
}

func (*IntegrationFormWebhook) Get added in v1.0.0

func (f *IntegrationFormWebhook) Get(project *db.Project, masked bool)

func (*IntegrationFormWebhook) Test added in v1.0.0

func (f *IntegrationFormWebhook) Test(ctx context.Context, project *db.Project) error

func (*IntegrationFormWebhook) Update added in v1.0.0

func (f *IntegrationFormWebhook) Update(ctx context.Context, project *db.Project, clear bool) error

func (*IntegrationFormWebhook) Valid added in v1.0.0

func (f *IntegrationFormWebhook) Valid() bool

type IntegrationsForm

type IntegrationsForm struct {
	BaseUrl string `json:"base_url"`
}

func (*IntegrationsForm) Valid

func (f *IntegrationsForm) Valid() bool

type LoginForm added in v1.5.0

type LoginForm struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Action   string `json:"action"`
}

func (*LoginForm) Valid added in v1.5.0

func (f *LoginForm) Valid() bool

type ProjectForm

type ProjectForm struct {
	Name           string   `json:"name"`
	MemberProjects []string `json:"member_projects"`
}

func (*ProjectForm) Valid

func (f *ProjectForm) Valid() bool

type UserAction added in v1.5.0

type UserAction string
const (
	UserActionCreate UserAction = "create"
	UserActionUpdate UserAction = "update"
	UserActionDelete UserAction = "delete"
)

type UserForm added in v1.5.0

type UserForm struct {
	Action   UserAction    `json:"action"`
	Id       int           `json:"id"`
	Email    string        `json:"email"`
	Name     string        `json:"name"`
	Role     rbac.RoleName `json:"role"`
	Password string        `json:"password"`
}

func (*UserForm) Valid added in v1.5.0

func (f *UserForm) Valid() bool

Jump to

Keyboard shortcuts

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