util

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2017 The Kubernetes Authors All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToAPICondition

func ConvertToAPICondition(condition types.Condition) v1.NodeCondition

ConvertToAPICondition converts the internal node condition to v1.NodeCondition.

func ConvertToAPIConditionStatus

func ConvertToAPIConditionStatus(status types.ConditionStatus) v1.ConditionStatus

ConvertToAPIConditionStatus converts the internal node condition status to v1.ConditionStatus.

func ConvertToAPIEventType

func ConvertToAPIEventType(severity types.Severity) string

ConvertToAPIEventType converts the internal severity to event type.

func ConvertToAPITimestamp

func ConvertToAPITimestamp(timestamp time.Time) metav1.Time

ConvertToAPITimestamp converts the timestamp to metav1.Time

func GenerateConditionChangeEvent added in v0.5.0

func GenerateConditionChangeEvent(t string, status types.ConditionStatus, reason string, timestamp time.Time) types.Event

GenerateConditionChangeEvent generates an event for condition change.

func GetStartTime added in v0.6.0

func GetStartTime(now time.Time, uptimeDuration time.Duration, lookbackStr string, delayStr string) (time.Time, error)

func GetUptimeDuration added in v0.6.0

func GetUptimeDuration() (time.Duration, error)

func ReturnHTTPError added in v0.3.0

func ReturnHTTPError(w http.ResponseWriter, err error)

ReturnHTTPError generates error http response.

func ReturnHTTPJson added in v0.3.0

func ReturnHTTPJson(w http.ResponseWriter, object interface{})

ReturnHTTPJson generates json http response.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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