本文整理汇总了Golang中github.com/kubernetes/dashboard/src/app/backend/resource/common.NewTypeMeta函数的典型用法代码示例。如果您正苦于以下问题:Golang NewTypeMeta函数的具体用法?Golang NewTypeMeta怎么用?Golang NewTypeMeta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewTypeMeta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: toNode
func toNode(node api.Node) Node {
return Node{
ObjectMeta: common.NewObjectMeta(node.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindNode),
Ready: getNodeConditionStatus(node, api.NodeReady),
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:7,代码来源:nodelist.go
示例2: getLimitRangeDetail
func getLimitRangeDetail(rawLimitRange *api.LimitRange) *LimitRangeDetail {
return &LimitRangeDetail{
ObjectMeta: common.NewObjectMeta(rawLimitRange.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindLimitRange),
LimitRanges: toLimitRanges(rawLimitRange.Spec.Limits),
}
}
开发者ID:bryk,项目名称:dashboard,代码行数:7,代码来源:limitrangedetail.go
示例3: getConfigMapDetail
func getConfigMapDetail(rawConfigMap *api.ConfigMap) *ConfigMapDetail {
return &ConfigMapDetail{
ObjectMeta: common.NewObjectMeta(rawConfigMap.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindConfigMap),
Data: rawConfigMap.Data,
}
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:7,代码来源:configmapdetail.go
示例4: toNamespace
func toNamespace(namespace api.Namespace) Namespace {
return Namespace{
ObjectMeta: common.NewObjectMeta(namespace.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindNamespace),
Phase: namespace.Status.Phase,
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:7,代码来源:namespacelist.go
示例5: getPersistentVolumeList
func getPersistentVolumeList(persistentVolumes []api.PersistentVolume, dsQuery *dataselect.DataSelectQuery) *PersistentVolumeList {
result := &PersistentVolumeList{
Items: make([]PersistentVolume, 0),
ListMeta: common.ListMeta{TotalItems: len(persistentVolumes)},
}
persistentVolumes = fromCells(dataselect.GenericDataSelect(toCells(persistentVolumes), dsQuery))
for _, item := range persistentVolumes {
var claim string
if item.Spec.ClaimRef != nil {
claim = item.Spec.ClaimRef.Name
}
result.Items = append(result.Items,
PersistentVolume{
ObjectMeta: common.NewObjectMeta(item.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPersistentVolume),
Capacity: item.Spec.Capacity,
AccessModes: item.Spec.AccessModes,
Status: item.Status.Phase,
Claim: claim,
Reason: item.Status.Reason,
})
}
return result
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:29,代码来源:persistentvolumelist.go
示例6: getSecretDetail
func getSecretDetail(rawSecret *api.Secret) *SecretDetail {
return &SecretDetail{
ObjectMeta: common.NewObjectMeta(rawSecret.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindSecret),
Data: rawSecret.Data,
Type: rawSecret.Type,
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:8,代码来源:secretdetail.go
示例7: ToReplicaSet
// ToReplicaSet converts replica set api object to replica set model object.
func ToReplicaSet(replicaSet *extensions.ReplicaSet, podInfo *common.PodInfo) ReplicaSet {
return ReplicaSet{
ObjectMeta: common.NewObjectMeta(replicaSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindReplicaSet),
ContainerImages: common.GetContainerImages(&replicaSet.Spec.Template.Spec),
Pods: *podInfo,
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:9,代码来源:replicasetcommon.go
示例8: getIngressDetail
func getIngressDetail(rawIngress *extensions.Ingress) *IngressDetail {
return &IngressDetail{
ObjectMeta: common.NewObjectMeta(rawIngress.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindIngress),
Spec: rawIngress.Spec,
Status: rawIngress.Status,
}
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:8,代码来源:ingressdetail.go
示例9: ToPetSet
// ToPetSet transforms pet set into PetSet object returned by API.
func ToPetSet(petSet *apps.PetSet, podInfo *common.PodInfo) PetSet {
return PetSet{
ObjectMeta: common.NewObjectMeta(petSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPetSet),
ContainerImages: common.GetContainerImages(&petSet.Spec.Template.Spec),
Pods: *podInfo,
}
}
开发者ID:cheld,项目名称:dashboard,代码行数:9,代码来源:petsetlist.go
示例10: ToStatefulSet
// ToStatefulSet transforms pet set into StatefulSet object returned by API.
func ToStatefulSet(statefulSet *apps.StatefulSet, podInfo *common.PodInfo) StatefulSet {
return StatefulSet{
ObjectMeta: common.NewObjectMeta(statefulSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindStatefulSet),
ContainerImages: common.GetContainerImages(&statefulSet.Spec.Template.Spec),
Pods: *podInfo,
}
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:9,代码来源:statefulsetlist.go
示例11: ToJob
func ToJob(job *batch.Job, podInfo *common.PodInfo) Job {
return Job{
ObjectMeta: common.NewObjectMeta(job.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindJob),
ContainerImages: common.GetContainerImages(&job.Spec.Template.Spec),
Pods: *podInfo,
}
}
开发者ID:cheld,项目名称:dashboard,代码行数:8,代码来源:joblist.go
示例12: NewIngress
// NewIngress - creates a new instance of Ingress struct based on K8s Ingress.
func NewIngress(ingress *extensions.Ingress) *Ingress {
modelIngress := &Ingress{
ObjectMeta: common.NewObjectMeta(ingress.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindIngress),
Endpoints: getEndpoints(ingress),
}
return modelIngress
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:10,代码来源:ingresslist.go
示例13: ToReplicationController
// ToReplicationController converts replication controller api object to replication controller
// model object.
func ToReplicationController(replicationController *api.ReplicationController,
podInfo *common.PodInfo) ReplicationController {
return ReplicationController{
ObjectMeta: common.NewObjectMeta(replicationController.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindReplicationController),
Pods: *podInfo,
ContainerImages: common.GetContainerImages(&replicationController.Spec.Template.Spec),
}
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:12,代码来源:replicationcontrollercommon.go
示例14: toNamespaceDetail
func toNamespaceDetail(namespace api.Namespace, events common.EventList, resourceQuotaList *resourcequota.ResourceQuotaDetailList) NamespaceDetail {
return NamespaceDetail{
ObjectMeta: common.NewObjectMeta(namespace.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindNamespace),
Phase: namespace.Status.Phase,
EventList: events,
ResourceQuotaList: resourceQuotaList,
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:10,代码来源:namespacedetail.go
示例15: getPersistentVolumeClaimDetail
func getPersistentVolumeClaimDetail(persistentVolumeClaim *api.PersistentVolumeClaim) *PersistentVolumeClaimDetail {
return &PersistentVolumeClaimDetail{
ObjectMeta: common.NewObjectMeta(persistentVolumeClaim.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPersistentVolumeClaim),
Status: persistentVolumeClaim.Status.Phase,
Volume: persistentVolumeClaim.Spec.VolumeName,
Capacity: persistentVolumeClaim.Status.Capacity,
AccessModes: persistentVolumeClaim.Spec.AccessModes,
}
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:11,代码来源:persistentvolumeclaimdetail.go
示例16: ToServiceDetail
// ToServiceDetail returns api service object based on kubernetes service object
func ToServiceDetail(service *api.Service) ServiceDetail {
return ServiceDetail{
ObjectMeta: common.NewObjectMeta(service.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindService),
InternalEndpoint: common.GetInternalEndpoint(service.Name, service.Namespace, service.Spec.Ports),
ExternalEndpoints: common.GetExternalEndpoints(service),
Selector: service.Spec.Selector,
ClusterIP: service.Spec.ClusterIP,
Type: service.Spec.Type,
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:12,代码来源:servicecommon.go
示例17: getPetSetDetail
func getPetSetDetail(petSet *apps.PetSet, heapsterClient client.HeapsterClient,
eventList common.EventList, podList pod.PodList, podInfo common.PodInfo) PetSetDetail {
return PetSetDetail{
ObjectMeta: common.NewObjectMeta(petSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindPetSet),
ContainerImages: common.GetContainerImages(&petSet.Spec.Template.Spec),
PodInfo: podInfo,
PodList: podList,
EventList: eventList,
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:12,代码来源:petsetdetail.go
示例18: TestNewSecretListCreation
func TestNewSecretListCreation(t *testing.T) {
cases := []struct {
k8sRs *api.SecretList
expected *SecretList
namespace *common.NamespaceQuery
}{
{
k8SecretList,
&SecretList{
Secrets: []Secret{
{
ObjectMeta: common.ObjectMeta{
Name: "user1",
Namespace: "foo",
CreationTimestamp: unversioned.Unix(111, 222),
},
TypeMeta: common.NewTypeMeta(common.ResourceKindSecret),
},
{
ObjectMeta: common.ObjectMeta{
Name: "user2",
Namespace: "foo",
CreationTimestamp: unversioned.Unix(111, 222),
},
TypeMeta: common.NewTypeMeta(common.ResourceKindSecret),
},
},
ListMeta: common.ListMeta{2},
},
common.NewNamespaceQuery([]string{"foo"}),
},
}
for _, c := range cases {
actual := NewSecretList(c.k8sRs.Items, dataselect.NoDataSelect)
if !reflect.DeepEqual(actual, c.expected) {
t.Errorf("NewSecretList() ==\n %#v\nExpected: %#v", actual, c.expected)
}
}
}
开发者ID:digitalfishpond,项目名称:dashboard,代码行数:40,代码来源:secret_test.go
示例19: getJobDetail
func getJobDetail(job *batch.Job, heapsterClient client.HeapsterClient,
eventList common.EventList, podList pod.PodList, podInfo common.PodInfo) JobDetail {
return JobDetail{
ObjectMeta: common.NewObjectMeta(job.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindJob),
ContainerImages: common.GetContainerImages(&job.Spec.Template.Spec),
PodInfo: podInfo,
PodList: podList,
EventList: eventList,
Parallelism: job.Spec.Parallelism,
Completions: job.Spec.Completions,
}
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:13,代码来源:jobdetail.go
示例20: ToReplicaSetDetail
// ToReplicaSetDetail converts replica set api object to replica set detail model object.
func ToReplicaSetDetail(replicaSet *extensions.ReplicaSet, eventList common.EventList,
podList pod.PodList, podInfo common.PodInfo, serviceList resourceService.ServiceList) ReplicaSetDetail {
return ReplicaSetDetail{
ObjectMeta: common.NewObjectMeta(replicaSet.ObjectMeta),
TypeMeta: common.NewTypeMeta(common.ResourceKindReplicaSet),
ContainerImages: common.GetContainerImages(&replicaSet.Spec.Template.Spec),
Selector: replicaSet.Spec.Selector,
PodInfo: podInfo,
PodList: podList,
ServiceList: serviceList,
EventList: eventList,
}
}
开发者ID:cheld,项目名称:dashboard,代码行数:15,代码来源:replicasetdetail.go
注:本文中的github.com/kubernetes/dashboard/src/app/backend/resource/common.NewTypeMeta函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论