當前位置: 首頁>>代碼示例>>Golang>>正文


Golang unversioned.Time類代碼示例

本文整理匯總了Golang中k8s/io/client-go/pkg/api/unversioned.Time的典型用法代碼示例。如果您正苦於以下問題:Golang Time類的具體用法?Golang Time怎麽用?Golang Time使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Time類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Convert_Slice_string_To_unversioned_Time

// Convert_Slice_string_To_unversioned_Time allows converting a URL query parameter value
func Convert_Slice_string_To_unversioned_Time(input *[]string, out *unversioned.Time, s conversion.Scope) error {
    str := ""
    if len(*input) > 0 {
        str = (*input)[0]
    }
    return out.UnmarshalQueryParameter(str)
}
開發者ID:,項目名稱:,代碼行數:8,代碼來源:

示例2: GetDeletionTimestamp

func (u *Unstructured) GetDeletionTimestamp() *unversioned.Time {
    var timestamp unversioned.Time
    timestamp.UnmarshalQueryParameter(getNestedString(u.Object, "metadata", "deletionTimestamp"))
    if timestamp.IsZero() {
        return nil
    }
    return &timestamp
}
開發者ID:,項目名稱:,代碼行數:8,代碼來源:

示例3: makeEvent

func (recorder *recorderImpl) makeEvent(ref *v1.ObjectReference, eventtype, reason, message string) *v1.Event {
    t := unversioned.Time{Time: recorder.clock.Now()}
    namespace := ref.Namespace
    if namespace == "" {
        namespace = v1.NamespaceDefault
    }
    return &v1.Event{
        ObjectMeta: v1.ObjectMeta{
            Name:      fmt.Sprintf("%v.%x", ref.Name, t.UnixNano()),
            Namespace: namespace,
        },
        InvolvedObject: *ref,
        Reason:         reason,
        Message:        message,
        FirstTimestamp: t,
        LastTimestamp:  t,
        Count:          1,
        Type:           eventtype,
    }
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:20,代碼來源:event.go

示例4: SetDeletionTimestamp

func (u *Unstructured) SetDeletionTimestamp(timestamp *unversioned.Time) {
    ts, _ := timestamp.MarshalQueryParameter()
    u.setNestedField(ts, "metadata", "deletionTimestamp")
}
開發者ID:,項目名稱:,代碼行數:4,代碼來源:

示例5: GetCreationTimestamp

func (u *Unstructured) GetCreationTimestamp() unversioned.Time {
    var timestamp unversioned.Time
    timestamp.UnmarshalQueryParameter(getNestedString(u.Object, "metadata", "creationTimestamp"))
    return timestamp
}
開發者ID:,項目名稱:,代碼行數:5,代碼來源:


注:本文中的k8s/io/client-go/pkg/api/unversioned.Time類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。