Documentation
¶
Index ¶
- Constants
- Variables
- func AddSearch(client search.Client, watcher *watcher.Watcher[*nais_io_v1alpha1.Application])
- func ErrorsPerSecondForIngress(ctx context.Context, obj *IngressMetrics) (float64, error)
- func NewIngressWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*netv1.Ingress]
- func NewLoaderContext(ctx context.Context, ...) context.Context
- func NewWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*nais_io_v1alpha1.Application]
- func RequestsPerSecondForIngress(ctx context.Context, obj *IngressMetrics) (float64, error)
- func Restart(ctx context.Context, teamSlug slug.Slug, environmentName, name string) error
- func StateCounts(ctx context.Context, apps []*Application) (running, notRunning, unknown int)
- type Application
- func Get(ctx context.Context, teamSlug slug.Slug, environment, name string) (*Application, error)
- func GetByIdent(ctx context.Context, id ident.Ident) (*Application, error)
- func ListAllForTeam(ctx context.Context, teamSlug slug.Slug, orderBy *ApplicationOrder, ...) []*Application
- func ListAllForTeamInEnvironment(ctx context.Context, teamSlug slug.Slug, environmentName string) []*Application
- func ListAllInEnvironment(ctx context.Context, environment string) []*Application
- func (a *Application) GetConfigs() []string
- func (a *Application) GetSecrets() []string
- func (a Application) ID() ident.Ident
- func (a *Application) Ingresses() []*Ingress
- func (Application) IsActivityLogger()
- func (Application) IsNode()
- func (Application) IsSearchNode()
- func (Application) IsWorkload()
- func (a *Application) Resources() *ApplicationResources
- type ApplicationConnection
- type ApplicationCreatedActivityLogEntry
- type ApplicationDeletedActivityLogEntry
- type ApplicationEdge
- type ApplicationFacets
- type ApplicationInstance
- type ApplicationInstanceConnection
- type ApplicationInstanceEdge
- type ApplicationInstanceState
- type ApplicationInstanceStatus
- type ApplicationManifest
- type ApplicationOrder
- type ApplicationOrderField
- type ApplicationResources
- type ApplicationRestartedActivityLogEntry
- type ApplicationScaledActivityLogEntry
- type ApplicationScaledActivityLogEntryData
- type ApplicationScaling
- type ApplicationState
- type ApplicationStateFacetItem
- type ApplicationUpdatedActivityLogEntry
- type ApplicationUpdatedActivityLogEntryData
- type CPUScalingStrategy
- type DeleteApplicationInput
- type DeleteApplicationPayload
- type Ingress
- type IngressMetricSample
- type IngressMetrics
- type IngressMetricsClient
- type IngressMetricsInput
- type IngressMetricsType
- type IngressType
- type KafkaLagScalingStrategy
- type RestartApplicationInput
- type RestartApplicationPayload
- type ScalingDirection
- type ScalingStrategy
- type TeamApplicationsFilter
- type TeamInventoryCountApplications
- type UpdateApplicationInput
- type UpdateApplicationPayload
- type UpdateApplicationReplicasInput
Constants ¶
View Source
const (
ActivityLogEntryResourceTypeApplication activitylog.ActivityLogEntryResourceType = "APP"
)
Variables ¶
View Source
var AllApplicationInstanceState = []ApplicationInstanceState{ ApplicationInstanceStateRunning, ApplicationInstanceStateStarting, ApplicationInstanceStateFailing, ApplicationInstanceStateTerminated, ApplicationInstanceStateUnknown, }
View Source
var AllApplicationState = []ApplicationState{ ApplicationStateUnknown, ApplicationStateRunning, ApplicationStateNotRunning, }
View Source
var AllIngressMetricsType = []IngressMetricsType{ IngressMetricsTypeRequestsPerSecond, IngressMetricsTypeErrorsPerSecond, }
View Source
var AllIngressType = []IngressType{ IngressTypeUnknown, IngressTypeExternal, IngressTypeInternal, IngressTypeAuthenticated, }
View Source
var AllScalingDirection = []ScalingDirection{ ScalingDirectionUp, ScalingDirectionDown, }
View Source
var SortFilter = sortfilter.New[*Application, ApplicationOrderField, *TeamApplicationsFilter]()
Functions ¶
func AddSearch ¶
func AddSearch(client search.Client, watcher *watcher.Watcher[*nais_io_v1alpha1.Application])
func ErrorsPerSecondForIngress ¶
func ErrorsPerSecondForIngress(ctx context.Context, obj *IngressMetrics) (float64, error)
func NewIngressWatcher ¶
func NewLoaderContext ¶
func NewLoaderContext(ctx context.Context, appWatcher *watcher.Watcher[*nais_io_v1alpha1.Application], ingressWatcher *watcher.Watcher[*netv1.Ingress], client IngressMetricsClient, log logrus.FieldLogger) context.Context
func NewWatcher ¶
func NewWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*nais_io_v1alpha1.Application]
func RequestsPerSecondForIngress ¶
func RequestsPerSecondForIngress(ctx context.Context, obj *IngressMetrics) (float64, error)
func StateCounts ¶
func StateCounts(ctx context.Context, apps []*Application) (running, notRunning, unknown int)
StateCounts computes the number of applications in each state for a given list of applications.
Types ¶
type Application ¶
type Application struct {
workload.Base
Spec *nais_io_v1alpha1.ApplicationSpec `json:"-"`
}
func GetByIdent ¶
func ListAllForTeam ¶
func ListAllForTeam(ctx context.Context, teamSlug slug.Slug, orderBy *ApplicationOrder, filter *TeamApplicationsFilter) []*Application
func ListAllInEnvironment ¶
func ListAllInEnvironment(ctx context.Context, environment string) []*Application
func (*Application) GetConfigs ¶
func (a *Application) GetConfigs() []string
GetConfigs returns a list of config names used by the application
func (*Application) GetSecrets ¶
func (a *Application) GetSecrets() []string
GetSecrets returns a list of secret names used by the application
func (Application) ID ¶
func (a Application) ID() ident.Ident
func (*Application) Ingresses ¶
func (a *Application) Ingresses() []*Ingress
func (Application) IsActivityLogger ¶
func (Application) IsActivityLogger()
func (Application) IsNode ¶
func (Application) IsNode()
func (Application) IsSearchNode ¶
func (Application) IsSearchNode()
func (Application) IsWorkload ¶
func (Application) IsWorkload()
func (*Application) Resources ¶
func (a *Application) Resources() *ApplicationResources
type ApplicationConnection ¶
type ApplicationConnection = pagination.FacetableConnection[*Application, *TeamApplicationsFilter]
type ApplicationCreatedActivityLogEntry ¶
type ApplicationCreatedActivityLogEntry struct {
activitylog.GenericActivityLogEntry
Data *activitylog.GenericKubernetesResourceActivityLogEntryData `json:"data"`
}
type ApplicationDeletedActivityLogEntry ¶
type ApplicationDeletedActivityLogEntry struct {
activitylog.GenericActivityLogEntry
}
type ApplicationEdge ¶
type ApplicationEdge = pagination.Edge[*Application]
type ApplicationFacets ¶
type ApplicationFacets struct {
Environments []model.StringFacetItem `json:"environments"`
States []ApplicationStateFacetItem `json:"states"`
}
func ComputeFacets ¶
func ComputeFacets(ctx context.Context, allApps []*Application, filter *TeamApplicationsFilter) (*ApplicationFacets, error)
ComputeFacets computes facets for an application query.
type ApplicationInstance ¶
type ApplicationInstance struct {
Name string `json:"name"`
Restarts int `json:"restarts"`
Created time.Time `json:"created"`
ImageString string `json:"-"`
EnvironmentName string `json:"-"`
TeamSlug slug.Slug `json:"-"`
ApplicationName string `json:"-"`
ApplicationContainerStatus corev1.ContainerStatus `json:"-"`
}
func ListAllInstances ¶
func (ApplicationInstance) ID ¶
func (i ApplicationInstance) ID() ident.Ident
func (ApplicationInstance) Image ¶
func (i ApplicationInstance) Image() *workload.ContainerImage
func (ApplicationInstance) IsNode ¶
func (ApplicationInstance) IsNode()
func (*ApplicationInstance) State ¶
func (i *ApplicationInstance) State() ApplicationInstanceState
func (*ApplicationInstance) Status ¶
func (i *ApplicationInstance) Status() *ApplicationInstanceStatus
type ApplicationInstanceConnection ¶
type ApplicationInstanceConnection = pagination.Connection[*ApplicationInstance]
func ListInstances ¶
func ListInstances(ctx context.Context, teamSlug slug.Slug, environmentName, appName string, page *pagination.Pagination) (*ApplicationInstanceConnection, error)
type ApplicationInstanceEdge ¶
type ApplicationInstanceEdge = pagination.Edge[*ApplicationInstance]
type ApplicationInstanceState ¶
type ApplicationInstanceState string
const ( ApplicationInstanceStateRunning ApplicationInstanceState = "RUNNING" ApplicationInstanceStateStarting ApplicationInstanceState = "STARTING" ApplicationInstanceStateFailing ApplicationInstanceState = "FAILING" ApplicationInstanceStateTerminated ApplicationInstanceState = "TERMINATED" ApplicationInstanceStateUnknown ApplicationInstanceState = "UNKNOWN" )
func (ApplicationInstanceState) IsValid ¶
func (e ApplicationInstanceState) IsValid() bool
func (ApplicationInstanceState) MarshalGQL ¶
func (e ApplicationInstanceState) MarshalGQL(w io.Writer)
func (ApplicationInstanceState) String ¶
func (e ApplicationInstanceState) String() string
func (*ApplicationInstanceState) UnmarshalGQL ¶
func (e *ApplicationInstanceState) UnmarshalGQL(v any) error
type ApplicationInstanceStatus ¶
type ApplicationInstanceStatus struct {
State ApplicationInstanceState `json:"state"`
Message string `json:"message"`
Ready bool `json:"ready"`
LastExitReason *string `json:"lastExitReason,omitempty"`
LastExitCode *int `json:"lastExitCode,omitempty"`
LastExitTimestamp *time.Time `json:"lastExitTimestamp,omitempty"`
}
type ApplicationManifest ¶
type ApplicationManifest struct {
Content string `json:"content"`
}
func (ApplicationManifest) IsWorkloadManifest ¶
func (ApplicationManifest) IsWorkloadManifest()
type ApplicationOrder ¶
type ApplicationOrder struct {
Field ApplicationOrderField `json:"field"`
Direction model.OrderDirection `json:"direction"`
}
type ApplicationOrderField ¶
type ApplicationOrderField string
func (ApplicationOrderField) IsValid ¶
func (e ApplicationOrderField) IsValid() bool
func (ApplicationOrderField) MarshalGQL ¶
func (e ApplicationOrderField) MarshalGQL(w io.Writer)
func (ApplicationOrderField) String ¶
func (e ApplicationOrderField) String() string
func (*ApplicationOrderField) UnmarshalGQL ¶
func (e *ApplicationOrderField) UnmarshalGQL(v any) error
type ApplicationResources ¶
type ApplicationResources struct {
Limits *workload.WorkloadResourceQuantity `json:"limits"`
Requests *workload.WorkloadResourceQuantity `json:"requests"`
Scaling *ApplicationScaling `json:"scaling"`
}
func (ApplicationResources) IsWorkloadResources ¶
func (ApplicationResources) IsWorkloadResources()
type ApplicationRestartedActivityLogEntry ¶
type ApplicationRestartedActivityLogEntry struct {
activitylog.GenericActivityLogEntry
}
type ApplicationScaledActivityLogEntry ¶
type ApplicationScaledActivityLogEntry struct {
activitylog.GenericActivityLogEntry
Data *ApplicationScaledActivityLogEntryData `json:"data"`
}
type ApplicationScaledActivityLogEntryData ¶
type ApplicationScaledActivityLogEntryData struct {
NewSize int `json:"newSize,string"`
Direction ScalingDirection `json:"direction"`
}
type ApplicationScaling ¶
type ApplicationScaling struct {
MinInstances int `json:"minInstances"`
MaxInstances int `json:"maxInstances"`
Strategies []ScalingStrategy `json:"strategies"`
}
type ApplicationState ¶
type ApplicationState int
const ( ApplicationStateUnknown ApplicationState = iota ApplicationStateRunning ApplicationStateNotRunning )
func GetState ¶
func GetState(ctx context.Context, obj *Application) (ApplicationState, error)
func (ApplicationState) IsValid ¶
func (e ApplicationState) IsValid() bool
func (ApplicationState) MarshalGQL ¶
func (e ApplicationState) MarshalGQL(w io.Writer)
func (ApplicationState) String ¶
func (e ApplicationState) String() string
func (*ApplicationState) UnmarshalGQL ¶
func (e *ApplicationState) UnmarshalGQL(v any) error
type ApplicationStateFacetItem ¶
type ApplicationStateFacetItem struct {
State ApplicationState `json:"state"`
Count int `json:"count"`
}
type ApplicationUpdatedActivityLogEntry ¶
type ApplicationUpdatedActivityLogEntry struct {
activitylog.GenericActivityLogEntry
Data *ApplicationUpdatedActivityLogEntryData `json:"data"`
}
type ApplicationUpdatedActivityLogEntryData ¶
type ApplicationUpdatedActivityLogEntryData struct {
ChangedFields []*activitylog.ResourceChangedField `json:"changedFields"`
GitHubActorClaims *activitylog.GitHubActorClaims `json:"gitHubActorClaims,omitempty"`
}
type CPUScalingStrategy ¶
type CPUScalingStrategy struct {
Threshold int `json:"threshold"`
}
func (CPUScalingStrategy) IsScalingStrategy ¶
func (CPUScalingStrategy) IsScalingStrategy()
type DeleteApplicationInput ¶
type IngressMetricSample ¶
type IngressMetricSample struct {
Timestamp time.Time `json:"timestamp"`
Value float64 `json:"value"`
}
func SeriesForIngress ¶
func SeriesForIngress(ctx context.Context, obj *IngressMetrics, input IngressMetricsInput) ([]*IngressMetricSample, error)
type IngressMetrics ¶
type IngressMetrics struct {
Ingress *Ingress `json:"-"`
}
type IngressMetricsClient ¶
type IngressMetricsInput ¶
type IngressMetricsInput struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Type IngressMetricsType `json:"type"`
}
func (*IngressMetricsInput) Step ¶
func (w *IngressMetricsInput) Step() int
type IngressMetricsType ¶
type IngressMetricsType string
const ( IngressMetricsTypeRequestsPerSecond IngressMetricsType = "REQUESTS_PER_SECOND" IngressMetricsTypeErrorsPerSecond IngressMetricsType = "ERRORS_PER_SECOND" )
func (IngressMetricsType) IsValid ¶
func (e IngressMetricsType) IsValid() bool
func (IngressMetricsType) MarshalGQL ¶
func (e IngressMetricsType) MarshalGQL(w io.Writer)
func (IngressMetricsType) String ¶
func (e IngressMetricsType) String() string
func (*IngressMetricsType) UnmarshalGQL ¶
func (e *IngressMetricsType) UnmarshalGQL(v any) error
type IngressType ¶
type IngressType string
const ( IngressTypeUnknown IngressType = "UNKNOWN" IngressTypeExternal IngressType = "EXTERNAL" IngressTypeInternal IngressType = "INTERNAL" IngressTypeAuthenticated IngressType = "AUTHENTICATED" )
func GetIngressType ¶
func GetIngressType(ctx context.Context, ingress *Ingress) IngressType
func (IngressType) IsValid ¶
func (e IngressType) IsValid() bool
func (IngressType) MarshalGQL ¶
func (e IngressType) MarshalGQL(w io.Writer)
func (IngressType) String ¶
func (e IngressType) String() string
func (*IngressType) UnmarshalGQL ¶
func (e *IngressType) UnmarshalGQL(v any) error
type KafkaLagScalingStrategy ¶
type KafkaLagScalingStrategy struct {
Threshold int `json:"threshold"`
ConsumerGroup string `json:"consumerGroup"`
TopicName string `json:"topicName"`
}
func (KafkaLagScalingStrategy) IsScalingStrategy ¶
func (KafkaLagScalingStrategy) IsScalingStrategy()
type RestartApplicationInput ¶
type ScalingDirection ¶
type ScalingDirection string
const ( ScalingDirectionUp ScalingDirection = "UP" ScalingDirectionDown ScalingDirection = "DOWN" )
func (ScalingDirection) IsValid ¶
func (e ScalingDirection) IsValid() bool
func (ScalingDirection) MarshalGQL ¶
func (e ScalingDirection) MarshalGQL(w io.Writer)
func (ScalingDirection) String ¶
func (e ScalingDirection) String() string
func (*ScalingDirection) UnmarshalGQL ¶
func (e *ScalingDirection) UnmarshalGQL(v any) error
type ScalingStrategy ¶
type ScalingStrategy interface {
IsScalingStrategy()
}
type TeamApplicationsFilter ¶
type TeamApplicationsFilter struct {
Name string `json:"name"`
Environments []string `json:"environments"`
States []ApplicationState `json:"states"`
}
type UpdateApplicationInput ¶
type UpdateApplicationInput struct {
Name string `json:"name"`
TeamSlug slug.Slug `json:"teamSlug"`
EnvironmentName string `json:"environmentName"`
EnvironmentVariables []*workload.UpdateWorkloadEnvironmentVariableInput `json:"environmentVariables,omitempty"`
Replicas *UpdateApplicationReplicasInput `json:"replicas,omitempty"`
Image *string `json:"image,omitempty"`
}
type UpdateApplicationPayload ¶
type UpdateApplicationPayload struct {
TeamSlug slug.Slug `json:"-"`
ApplicationName string `json:"-"`
EnvironmentName string `json:"-"`
}
func Update ¶
func Update(ctx context.Context, input UpdateApplicationInput) (*UpdateApplicationPayload, error)
Click to show internal directories.
Click to hide internal directories.