go-micro: github.com/micro/go-micro/util/kubernetes/api Index | Files

package api

import "github.com/micro/go-micro/util/kubernetes/api"


Package Files

request.go response.go


var (
    ErrNotFound = errors.New("kubernetes: resource not found")
    ErrDecode   = errors.New("kubernetes: error decoding")
    ErrUnknown  = errors.New("kubernetes: unknown error")

Errors ...

type Options Uses

type Options struct {
    Host        string
    Namespace   string
    BearerToken *string
    Client      *http.Client

Options ...

type Params Uses

type Params struct {
    LabelSelector map[string]string
    Annotations   map[string]string
    Additional    map[string]string

Params is the object to pass in to set paramaters on a request.

type Request Uses

type Request struct {
    // contains filtered or unexported fields

Request is used to construct a http request for the k8s API.

func NewRequest Uses

func NewRequest(opts *Options) *Request

NewRequest creates a k8s api request

func (*Request) Body Uses

func (r *Request) Body(in interface{}) *Request

Body pass in a body to set, this is for POST, PUT and PATCH requests

func (*Request) Context Uses

func (r *Request) Context(ctx context.Context)

func (*Request) Delete Uses

func (r *Request) Delete() *Request

Delete request

func (*Request) Do Uses

func (r *Request) Do() *Response

Do builds and triggers the request

func (*Request) Get Uses

func (r *Request) Get() *Request

Get request

func (*Request) Name Uses

func (r *Request) Name(s string) *Request

Name is for targeting a specific resource by id

func (*Request) Namespace Uses

func (r *Request) Namespace(s string) *Request

Namespace is to set the namespace to operate on

func (*Request) Params Uses

func (r *Request) Params(p *Params) *Request

Params isused to set paramters on a request

func (*Request) Patch Uses

func (r *Request) Patch() *Request

Patch request

func (*Request) Post Uses

func (r *Request) Post() *Request

Post request

func (*Request) Put Uses

func (r *Request) Put() *Request

Put request

func (*Request) Raw Uses

func (r *Request) Raw() (*http.Response, error)

Raw performs a Raw HTTP request to the Kubernetes API

func (*Request) Resource Uses

func (r *Request) Resource(s string) *Request

Resource is the type of resource the operation is for, such as "services", "endpoints" or "pods"

func (*Request) SetHeader Uses

func (r *Request) SetHeader(key, value string) *Request

SetHeader sets a header on a request with a `key` and `value`

func (*Request) SubResource Uses

func (r *Request) SubResource(s string) *Request

SubResource sets a subresource on a resource, e.g. pods/log for pod logs

type Response Uses

type Response struct {
    // contains filtered or unexported fields

Response ...

func (*Response) Close Uses

func (r *Response) Close() error

func (*Response) Error Uses

func (r *Response) Error() error

Error returns an error

func (*Response) Into Uses

func (r *Response) Into(data interface{}) error

Into decode body into `data`

func (*Response) StatusCode Uses

func (r *Response) StatusCode() int

StatusCode returns status code for response

type Status Uses

type Status struct {
    Kind    string `json:"kind"`
    Status  string `json:"status"`
    Message string `json:"message"`
    Reason  string `json:"reason"`
    Code    int    `json:"code"`

Status is an object that is returned when a request failed or delete succeeded.

Package api imports 9 packages (graph) and is imported by 1 packages. Updated 2020-02-22. Refresh now. Tools for package owners.