Documentation ¶
Index ¶
- Variables
- func GetLogger() *logrus.Logger
- func IntInSlice(i int, l []int) bool
- func NewForbidden(qualifiedResource schema.GroupResource, name string, err error) *errors.StatusError
- func NewInternalError(err error) *errors.StatusError
- func NewInvalid(qualifiedKind schema.GroupKind, name string, fieldName string, err error) *errors.StatusError
- func NewNotFound(qualifiedResource schema.GroupResource, name string, message string) *errors.StatusError
- func NewUnauthorized(reason string) *errors.StatusError
- func StringInSlice(s string, l []string) bool
- func UpdateLoggerLevel(level logrus.Level)
- func WriteErrorResponse(rw http.ResponseWriter, statusCode int, err *types.ErrorResponse)
- func WriteKubeAPIError(rw http.ResponseWriter, err *errors.StatusError)
- type SimpleContext
- type TraceContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ClusterGroupKind = v1.Kind("Cluster")
View Source
var ClusterResource = v1.Resource("Clusters")
Functions ¶
func IntInSlice ¶
func NewForbidden ¶
func NewForbidden(qualifiedResource schema.GroupResource, name string, err error) *errors.StatusError
func NewInternalError ¶
func NewInternalError(err error) *errors.StatusError
func NewInvalid ¶
func NewInvalid(qualifiedKind schema.GroupKind, name string, fieldName string, err error) *errors.StatusError
NewInvalid returns an error indicating the item is invalid and cannot be processed.
func NewNotFound ¶
func NewNotFound(qualifiedResource schema.GroupResource, name string, message string) *errors.StatusError
NewNotFound returns a new error which indicates that the resource of the kind and the name was not found.
func NewUnauthorized ¶
func NewUnauthorized(reason string) *errors.StatusError
NewUnauthorized returns an error indicating the client is not authorized to perform the requested action.
func StringInSlice ¶
StringInSlice returns true if given string in slice
func UpdateLoggerLevel ¶
func WriteErrorResponse ¶
func WriteErrorResponse(rw http.ResponseWriter, statusCode int, err *types.ErrorResponse)
WriteErrorResponse writes a standard error response
func WriteKubeAPIError ¶
func WriteKubeAPIError(rw http.ResponseWriter, err *errors.StatusError)
WriteKubeAPIError writes a standard error response
Types ¶
type SimpleContext ¶
type SimpleContext struct{}
func (SimpleContext) Levels ¶
func (hook SimpleContext) Levels() []logrus.Level
type TraceContext ¶
func NewTraceContext ¶
func NewTraceContext(showFileno, showFuncField bool) *TraceContext
func (TraceContext) Fire ¶
func (hook TraceContext) Fire(entry *logrus.Entry) error
Fire adds filename and lino number info compare to the original log format
func (TraceContext) Levels ¶
func (hook TraceContext) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.