Documentation
¶
Index ¶
- Constants
- func ApplyApplicationWithSync(client kubernetes.Interface, radixclient radixclient.Interface, ...)
- func ApplyDeploymentWithSync(client kubernetes.Interface, radixclient radixclient.Interface, ...)
- func ApplyRegistrationWithSync(client kubernetes.Interface, radixclient radixclient.Interface, ...)
- func BearerTokenHeaderVerifyerMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func BearerTokenQueryVerifyerMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func ByteArrayResponse(w http.ResponseWriter, r *http.Request, contentType string, result []byte)
- func CreateApplicationConfig(client kubernetes.Interface, radixClient radixclient.Interface, appName string) (*applicationconfig.ApplicationConfig, error)
- func ErrorResponse(w http.ResponseWriter, r *http.Request, apiError error)
- func FormatTime(time *metav1.Time) string
- func FormatTimestamp(timestamp time.Time) string
- func GetTokenFromQuery(request *http.Request) string
- func IsBefore(j, i Job) bool
- func JSONResponse(w http.ResponseWriter, r *http.Request, result interface{})
- func NotFoundError(message string) error
- func ParseTimestamp(timestamp string) (time.Time, error)
- func ParseTimestampNillable(timestamp string) *time.Time
- func StringResponse(w http.ResponseWriter, r *http.Request, result string)
- func TypeMissingError(message string, underlyingError error) error
- func UnexpectedError(message string, underlyingError error) error
- func ValidationError(kind, message string) error
- type DeployKey
- type Error
- type Job
- type KubeUtil
- type RadixMiddleware
- type Type
Constants ¶
const ( // Server The operation looked fine on paper, but something went wrong Server Type = "server" // Missing The thing you mentioned, whatever it is, just doesn't exist Missing = "missing" // User The operation was well-formed, but you asked for something that // can't happen at present (e.g., because you've not supplied some // config yet) User = "user" )
Variables ¶
This section is empty.
Functions ¶
func ApplyApplicationWithSync ¶
func ApplyApplicationWithSync(client kubernetes.Interface, radixclient radixclient.Interface, commonTestUtils *commontest.Utils, applicationBuilder utils.ApplicationBuilder)
ApplyApplicationWithSync syncs based on application builder, and default builder for registration.
func ApplyDeploymentWithSync ¶
func ApplyDeploymentWithSync(client kubernetes.Interface, radixclient radixclient.Interface, promclient prometheusclient.Interface, commonTestUtils *commontest.Utils, deploymentBuilder builders.DeploymentBuilder)
ApplyDeploymentWithSync syncs based on deployment builder, and default builders for application and registration.
func ApplyRegistrationWithSync ¶
func ApplyRegistrationWithSync(client kubernetes.Interface, radixclient radixclient.Interface, commonTestUtils *commontest.Utils, registrationBuilder utils.RegistrationBuilder)
ApplyRegistrationWithSync syncs based on registration builder
func BearerTokenHeaderVerifyerMiddleware ¶
func BearerTokenHeaderVerifyerMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
BearerTokenHeaderVerifyerMiddleware Will verify that the request has a bearer token in header
func BearerTokenQueryVerifyerMiddleware ¶
func BearerTokenQueryVerifyerMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
BearerTokenQueryVerifyerMiddleware Will verify that the request has a bearer token as query variable
func ByteArrayResponse ¶ added in v1.7.1
ByteArrayResponse Used for response data. I.e. image
func CreateApplicationConfig ¶
func CreateApplicationConfig(client kubernetes.Interface, radixClient radixclient.Interface, appName string) (*applicationconfig.ApplicationConfig, error)
CreateApplicationConfig creates an application config based on input
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, r *http.Request, apiError error)
ErrorResponse Marshals error
func FormatTime ¶
FormatTime Converts kubernetes time to formatted timestamp
func FormatTimestamp ¶
FormatTimestamp Converts time to formatted timestamp
func GetTokenFromQuery ¶
GetTokenFromQuery Gets token from query of the request
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, r *http.Request, result interface{})
JSONResponse Marshals response with header
func NotFoundError ¶ added in v1.7.1
func ParseTimestamp ¶
ParseTimestamp Converts timestamp to time
func ParseTimestampNillable ¶ added in v1.9.0
ParseTimestampNillable Converts timestamp to time or nil
func StringResponse ¶
func StringResponse(w http.ResponseWriter, r *http.Request, result string)
StringResponse Used for textual response data. I.e. log data
func TypeMissingError ¶
TypeMissingError indication of underlying type missing
func UnexpectedError ¶
UnexpectedError any unexpected error
func ValidationError ¶
ValidationError Used for indication of validation errors
Types ¶
type DeployKey ¶
DeployKey Represention of a deploy key pair
func GenerateDeployKey ¶
GenerateDeployKey Generates a deploy key
type Error ¶
type Error struct { Type Type // a message that can be printed out for the user Message string `json:"message"` // the underlying error that can be e.g., logged for developers to look at Err error }
Error Representation of errors in the API. These are divided into a small number of categories, essentially distinguished by whose fault the error is; i.e., is this error:
- a transient problem with the service, so worth trying again?
- not going to work until the user takes some other action, e.g., updating config?
func (*Error) MarshalJSON ¶
MarshalJSON Writes error as json
func (*Error) UnmarshalJSON ¶
UnmarshalJSON Parses json
type KubeUtil ¶
type KubeUtil interface { GetOutClusterKubernetesClient(string) (kubernetes.Interface, radixclient.Interface) GetOutClusterKubernetesClientWithImpersonation(string, models.Impersonation) (kubernetes.Interface, radixclient.Interface) GetInClusterKubernetesClient() (kubernetes.Interface, radixclient.Interface) }
KubeUtil Interface to be mocked in tests
type RadixMiddleware ¶
type RadixMiddleware struct {
// contains filtered or unexported fields
}
RadixMiddleware The middleware beween router and radix handler functions
func NewRadixMiddleware ¶
func NewRadixMiddleware(kubeUtil KubeUtil, path, method string, allowUnauthenticatedUsers bool, next models.RadixHandlerFunc) *RadixMiddleware
NewRadixMiddleware Constructor for radix middleware
func (*RadixMiddleware) Handle ¶
func (handler *RadixMiddleware) Handle(w http.ResponseWriter, r *http.Request)
Handle Wraps radix handler methods
func (*RadixMiddleware) HandleNoAuth ¶ added in v1.7.1
func (handler *RadixMiddleware) HandleNoAuth(w http.ResponseWriter, r *http.Request)