application

package
v0.0.0-...-2a06ba9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewIngressWatcher

func NewIngressWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*netv1.Ingress]

func NewLoaderContext

func NewLoaderContext(ctx context.Context, appWatcher *watcher.Watcher[*nais_io_v1alpha1.Application], ingressWatcher *watcher.Watcher[*netv1.Ingress]) context.Context

func Restart

func Restart(ctx context.Context, teamSlug slug.Slug, environmentName, name string) error
func Search(ctx context.Context, q string) ([]*search.Result, error)

Types

type Application

type Application struct {
	workload.Base
	Spec *nais_io_v1alpha1.ApplicationSpec `json:"-"`
}

func Get

func Get(ctx context.Context, teamSlug slug.Slug, environment, name string) (*Application, error)

func GetByIdent

func GetByIdent(ctx context.Context, id ident.Ident) (*Application, error)

func ListAllForTeam

func ListAllForTeam(ctx context.Context, teamSlug slug.Slug) []*Application

func ListAllForTeamInEnvironment

func ListAllForTeamInEnvironment(ctx context.Context, teamSlug slug.Slug, environmentName string) []*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) 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.Connection[*Application]

type ApplicationDeletedActivityLogEntry

type ApplicationDeletedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type ApplicationEdge

type ApplicationEdge = pagination.Edge[*Application]

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 ListAllInstances(ctx context.Context, teamSlug slug.Slug, environmentName, appName string) ([]*ApplicationInstance, error)

func (ApplicationInstance) ID

func (ApplicationInstance) Image

func (ApplicationInstance) IsNode

func (ApplicationInstance) IsNode()

func (*ApplicationInstance) State

func (*ApplicationInstance) Status

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"
	ApplicationInstanceStateFailing ApplicationInstanceState = "FAILING"
	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 interface{}) error

type ApplicationInstanceStatus

type ApplicationInstanceStatus struct {
	State   ApplicationInstanceState `json:"state"`
	Message string                   `json:"message"`
}

type ApplicationManifest

type ApplicationManifest struct {
	Content string `json:"content"`
}

func Manifest

func Manifest(ctx context.Context, teamSlug slug.Slug, environmentName, name string) (*ApplicationManifest, error)

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
const (
	ApplicationOrderFieldName        ApplicationOrderField = "NAME"
	ApplicationOrderFieldEnvironment ApplicationOrderField = "ENVIRONMENT"
)

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 interface{}) 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 ApplicationScaling

type ApplicationScaling struct {
	MinInstances int               `json:"minInstances"`
	MaxInstances int               `json:"maxInstances"`
	Strategies   []ScalingStrategy `json:"strategies"`
}

type CPUScalingStrategy

type CPUScalingStrategy struct {
	Threshold int `json:"threshold"`
}

func (CPUScalingStrategy) IsScalingStrategy

func (CPUScalingStrategy) IsScalingStrategy()

type DeleteApplicationInput

type DeleteApplicationInput struct {
	Name            string    `json:"name"`
	TeamSlug        slug.Slug `json:"teamSlug"`
	EnvironmentName string    `json:"environmentName"`
}

type DeleteApplicationPayload

type DeleteApplicationPayload struct {
	TeamSlug *slug.Slug `json:"-"`
	Success  bool       `json:"-"`
}

func Delete

func Delete(ctx context.Context, teamSlug slug.Slug, environmentName, name string) (*DeleteApplicationPayload, error)

type Ingress

type Ingress struct {
	URL             string    `json:"url"`
	EnvironmentName string    `json:"-"`
	TeamSlug        slug.Slug `json:"-"`
	ApplicationName string    `json:"-"`
}

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 interface{}) 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 RestartApplicationInput struct {
	Name            string    `json:"name"`
	TeamSlug        slug.Slug `json:"teamSlug"`
	EnvironmentName string    `json:"environmentName"`
}

type RestartApplicationPayload

type RestartApplicationPayload struct {
	TeamSlug        slug.Slug `json:"-"`
	ApplicationName string    `json:"-"`
	EnvironmentName string    `json:"-"`
}

type ScalingStrategy

type ScalingStrategy interface {
	IsScalingStrategy()
}

type TeamApplicationsFilter

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

type TeamInventoryCountApplications

type TeamInventoryCountApplications struct {
	// Total number of applications.
	Total int `json:"total"`
	// Number of applications considered not nais.
	NotNais int `json:"notNais"`
}

Jump to

Keyboard shortcuts

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