handlers

package
v1.0.0-beta.25 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 36 Imported by: 1

Documentation

Index

Constants

View Source
const CacheMiddlewareDefaultTTL = 1 * time.Minute

Variables

This section is empty.

Functions

func CORS

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

func CacheMiddleware

func CacheMiddleware(cache *cache, duration time.Duration) mux.MiddlewareFunc

func CorsMiddleware

func CorsMiddleware(next http.Handler) http.Handler

func DeleteCustomAppMetricsKey

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

func EnforceMockAccess

func EnforceMockAccess(next http.HandlerFunc) http.HandlerFunc

func GetAppHistory

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

func GetAppUpdates

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

func GetCurrentAppInfo

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

func GetIntegrationMockData

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

func GetIntegrationStatus

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

func GetLicenseField

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

func GetLicenseFields

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

func GetLicenseInfo

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

func Healthz

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

func IsSamePayload

func IsSamePayload(a, b []byte) bool

func JSON

func JSON(w http.ResponseWriter, code int, payload interface{})

func JSONCached

func JSONCached(w http.ResponseWriter, code int, payload interface{})

func NewCache

func NewCache() *cache

func PostIntegrationMockData

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

func RequireValidLicenseIDMiddleware

func RequireValidLicenseIDMiddleware(next http.Handler) http.Handler

func SendAppInstanceTags

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

func SendCustomAppMetrics

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

func SetTestClientSet

func SetTestClientSet(clientset kubernetes.Interface)

Types

type AppRelease

type AppRelease struct {
	VersionLabel         string `json:"versionLabel"`
	ReleaseNotes         string `json:"releaseNotes"`
	CreatedAt            string `json:"createdAt"`
	DeployedAt           string `json:"deployedAt"`
	HelmReleaseName      string `json:"helmReleaseName,omitempty"`
	HelmReleaseRevision  int    `json:"helmReleaseRevision,omitempty"`
	HelmReleaseNamespace string `json:"helmReleaseNamespace,omitempty"`
}

type CacheEntry

type CacheEntry struct {
	RequestBody  []byte
	ResponseBody []byte
	StatusCode   int
	Expiry       time.Time
}

Code for the cache middleware

type CustomAppMetricsData

type CustomAppMetricsData map[string]interface{}

type GetAppHistoryResponse

type GetAppHistoryResponse struct {
	Releases []AppRelease `json:"releases"`
}

type GetCurrentAppInfoResponse

type GetCurrentAppInfoResponse struct {
	InstanceID      string              `json:"instanceID"`
	AppSlug         string              `json:"appSlug"`
	AppName         string              `json:"appName"`
	AppStatus       appstatetypes.State `json:"appStatus"`
	HelmChartURL    string              `json:"helmChartURL,omitempty"`
	CurrentRelease  AppRelease          `json:"currentRelease"`
	ChannelID       string              `json:"channelID"`
	ChannelName     string              `json:"channelName"`
	ChannelSequence int64               `json:"channelSequence"`
	ReleaseSequence int64               `json:"releaseSequence"`
}

type GetIntegrationStatusResponse

type GetIntegrationStatusResponse struct {
	IsEnabled bool `json:"isEnabled"`
}

type HealthzResponse

type HealthzResponse struct {
	Version string `json:"version"`
}

type LicenseInfo

type LicenseInfo struct {
	LicenseID                      string                                  `json:"licenseID"`
	AppSlug                        string                                  `json:"appSlug"`
	ChannelName                    string                                  `json:"channelName"`
	CustomerName                   string                                  `json:"customerName"`
	CustomerEmail                  string                                  `json:"customerEmail"`
	LicenseType                    string                                  `json:"licenseType"`
	ChannelID                      string                                  `json:"channelID"`
	LicenseSequence                int64                                   `json:"licenseSequence"`
	IsAirgapSupported              bool                                    `json:"isAirgapSupported"`
	IsGitOpsSupported              bool                                    `json:"isGitOpsSupported"`
	IsIdentityServiceSupported     bool                                    `json:"isIdentityServiceSupported"`
	IsGeoaxisSupported             bool                                    `json:"isGeoaxisSupported"`
	IsSnapshotSupported            bool                                    `json:"isSnapshotSupported"`
	IsSupportBundleUploadSupported bool                                    `json:"isSupportBundleUploadSupported"`
	IsSemverRequired               bool                                    `json:"isSemverRequired"`
	Endpoint                       string                                  `json:"endpoint"`
	Entitlements                   map[string]kotsv1beta1.EntitlementField `json:"entitlements"`
}

type SendAppInstanceTagsRequest

type SendAppInstanceTagsRequest struct {
	Data types.InstanceTagData `json:"data"`
}

type SendCustomAppMetricsRequest

type SendCustomAppMetricsRequest struct {
	Data CustomAppMetricsData `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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