server

package
v0.0.0-...-acfd841 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2016 Iguazio Systems Ltd. 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

View Source
const (
	CRDPlural   string = "examples"
	CRDGroup    string = "myorg.io"
	CRDVersion  string = "v1"
	FullCRDName string = CRDPlural + "." + CRDGroup
)

Variables

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion}

Create a Rest client with the new CRD Schema

Functions

func CreateCRD

func CreateCRD(clientset apiextcs.Interface) error

Create the CRD resource, ignore error if it already exists

func NewClient

func NewClient(cfg *rest.Config) (*rest.RESTClient, *runtime.Scheme, error)

Types

type Example

type Example struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata"`
	Spec               ExampleSpec   `json:"spec"`
	Status             ExampleStatus `json:"status,omitempty"`
}

Definition of our CRD Example class

type ExampleList

type ExampleList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []Example `json:"items"`
}

type ExampleSpec

type ExampleSpec struct {
	Foo string `json:"foo"`
	Bar bool   `json:"bar"`
	Baz int    `json:"baz,omitempty"`
}

type ExampleStatus

type ExampleStatus struct {
	State   string `json:"state,omitempty"`
	Message string `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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