popeye: github.com/derailed/popeye/types Index | Files

package types

import "github.com/derailed/popeye/types"


Package Files



const (
    // CreateVerb represents create access on a resource.
    CreateVerb = "create"

    // UpdateVerb represents an update access on a resource.
    UpdateVerb = "update"

    // PatchVerb represents a patch access on a resource.
    PatchVerb = "patch"

    // DeleteVerb represents a delete access on a resource.
    DeleteVerb = "delete"

    // GetVerb represents a get access on a resource.
    GetVerb = "get"

    // ListVerb represents a list access on a resource.
    ListVerb = "list"

    // WatchVerb represents a watch access on a resource.
    WatchVerb = "watch"


var (
    // GetAccess reads a resource.
    GetAccess = []string{GetVerb}
    // ListAccess list resources.
    ListAccess = []string{ListVerb}
    // MonitorAccess monitors a collection of resources.
    MonitorAccess = []string{ListVerb, WatchVerb}
    // ReadAllAccess represents an all read access to a resource.
    ReadAllAccess = []string{GetVerb, ListVerb, WatchVerb}

type Authorizer Uses

type Authorizer interface {
    // CanI returns true if the user can use these actions for a given resource.
    CanI(ns, gvr string, verbs []string) (bool, error)

Authorizer checks what a user can or cannot do to a resource.

type Config Uses

type Config interface {
    CurrentNamespaceName() (string, error)
    CurrentClusterName() (string, error)
    Flags() *genericclioptions.ConfigFlags
    RESTConfig() (*restclient.Config, error)

Config represents an api server configuration.

type Connection Uses

type Connection interface {

    // Config returns current config.
    Config() Config

    // Dial connects to api server.
    Dial() (kubernetes.Interface, error)

    // CachedDiscovery connects to discovery client.
    CachedDiscovery() (*disk.CachedDiscoveryClient, error)

    // RestConfig connects to rest client.
    RestConfig() (*restclient.Config, error)

    // MXDial connects to metrics server.
    MXDial() (*versioned.Clientset, error)

    // DynDial connects to dynamic client.
    DynDial() (dynamic.Interface, error)

    // HasMetrics checks if metrics server is available.
    HasMetrics() bool

    // ServerVersion returns current server version.
    ServerVersion() (*version.Info, error)

    // ActiveCluster returns the current cluster name.
    ActiveCluster() string

    // ActiveNamespace returns the current namespace.
    ActiveNamespace() string

Connection represents a Kubenetes apiserver connection.

type Factory Uses

type Factory interface {
    // Client retrieves an api client.
    Client() Connection

    // Get fetch a given resource.
    Get(gvr, path string, wait bool, sel labels.Selector) (runtime.Object, error)

    // List fetch a collection of resources.
    List(gvr, ns string, wait bool, sel labels.Selector) ([]runtime.Object, error)

    // ForResource fetch an informer for a given resource.
    ForResource(ns, gvr string) (informers.GenericInformer, error)

    // CanForResource fetch an informer for a given resource if authorized
    CanForResource(ns, gvr string, verbs []string) (informers.GenericInformer, error)

    // WaitForCacheSync synchronize the cache.

Factory represents a resource factory.

Package types imports 10 packages (graph) and is imported by 7 packages. Updated 2020-07-16. Refresh now. Tools for package owners.