pachyderm: github.com/pachyderm/pachyderm/src/client/pkg/config Index | Files

package config

import "github.com/pachyderm/pachyderm/src/client/pkg/config"

Index

Package Files

config.go config.pb.go kube_config.go

Variables

var (
    ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowConfig   = fmt.Errorf("proto: integer overflow")
)
var ContextSource_name = map[int32]string{
    0:  "NONE",
    1:  "CONFIG_V1",
    2:  "HUB",
}
var ContextSource_value = map[string]int32{
    "NONE":      0,
    "CONFIG_V1": 1,
    "HUB":       2,
}

func KubeConfig Uses

func KubeConfig(context *Context) clientcmd.ClientConfig

KubeConfig gets the kubernetes config

type Config Uses

type Config struct {
    UserID string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
    // Configuration options. Exactly one of these fields should be set
    // (depending on which version of the config is being used)
    V1                   *ConfigV1 `protobuf:"bytes,2,opt,name=v1,proto3" json:"v1,omitempty"`
    V2                   *ConfigV2 `protobuf:"bytes,3,opt,name=v2,proto3" json:"v2,omitempty"`
    XXX_NoUnkeyedLiteral struct{}  `json:"-"`
    XXX_unrecognized     []byte    `json:"-"`
    XXX_sizecache        int32     `json:"-"`
}

Config specifies the pachyderm config that is read and interpreted by the pachctl command-line tool. Right now, this is stored at $HOME/.pachyderm/config.

Different versions of the pachyderm config are specified as subfields of this message (this allows us to make significant changes to the config structure without breaking existing users by defining a new config version).

DO NOT change or remove field numbers from this proto, otherwise ALL pachyderm user configs will fail to parse.

func Read Uses

func Read() (*Config, error)

Read loads the Pachyderm config on this machine. If an existing configuration cannot be found, it sets up the defaults. Read returns a nil Config if and only if it returns a non-nil error.

func (*Config) ActiveContext Uses

func (c *Config) ActiveContext() (string, *Context, error)

ActiveContext gets the active context in the config

func (*Config) Descriptor Uses

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetUserID Uses

func (m *Config) GetUserID() string

func (*Config) GetV1 Uses

func (m *Config) GetV1() *ConfigV1

func (*Config) GetV2 Uses

func (m *Config) GetV2() *ConfigV2

func (*Config) Marshal Uses

func (m *Config) Marshal() (dAtA []byte, err error)

func (*Config) MarshalTo Uses

func (m *Config) MarshalTo(dAtA []byte) (int, error)

func (*Config) MarshalToSizedBuffer Uses

func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Config) ProtoMessage Uses

func (*Config) ProtoMessage()

func (*Config) Reset Uses

func (m *Config) Reset()

func (*Config) Size Uses

func (m *Config) Size() (n int)

func (*Config) String Uses

func (m *Config) String() string

func (*Config) Unmarshal Uses

func (m *Config) Unmarshal(dAtA []byte) error

func (*Config) Write Uses

func (c *Config) Write() error

Write writes the configuration in 'c' to this machine's Pachyderm config file.

func (*Config) XXX_DiscardUnknown Uses

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal Uses

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge Uses

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size Uses

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal Uses

func (m *Config) XXX_Unmarshal(b []byte) error

type ConfigV1 Uses

type ConfigV1 struct {
    // A host:port pointing pachd at a pachyderm cluster. Similar to the
    // PACHD_ADDRESS environment variable, though PACHD_ADDRESS overrides
    // this.
    PachdAddress string `protobuf:"bytes,2,opt,name=pachd_address,json=pachdAddress,proto3" json:"pachd_address,omitempty"`
    // Trusted root certificates (overrides installed certificates), formatted
    // as base64-encoded PEM
    ServerCAs string `protobuf:"bytes,3,opt,name=server_cas,json=serverCas,proto3" json:"server_cas,omitempty"`
    // A secret token identifying the current pachctl user within their
    // pachyderm cluster. This is included in all RPCs sent by pachctl, and used
    // to determine if pachctl actions are authorized.
    SessionToken string `protobuf:"bytes,1,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"`
    // The currently active transaction for batching together pachctl commands.
    // This can be set or cleared via many of the `pachctl * transaction` commands.
    // This is the ID of the transaction object stored in the pachyderm etcd.
    ActiveTransaction    string   `protobuf:"bytes,4,opt,name=active_transaction,json=activeTransaction,proto3" json:"active_transaction,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

ConfigV1 specifies v1 of the pachyderm config (June 30 2017 - June 2019) DO NOT change or remove field numbers from this proto, as if you do, v1 user configs will become unparseable.

func (*ConfigV1) Descriptor Uses

func (*ConfigV1) Descriptor() ([]byte, []int)

func (*ConfigV1) GetActiveTransaction Uses

func (m *ConfigV1) GetActiveTransaction() string

func (*ConfigV1) GetPachdAddress Uses

func (m *ConfigV1) GetPachdAddress() string

func (*ConfigV1) GetServerCAs Uses

func (m *ConfigV1) GetServerCAs() string

func (*ConfigV1) GetSessionToken Uses

func (m *ConfigV1) GetSessionToken() string

func (*ConfigV1) Marshal Uses

func (m *ConfigV1) Marshal() (dAtA []byte, err error)

func (*ConfigV1) MarshalTo Uses

func (m *ConfigV1) MarshalTo(dAtA []byte) (int, error)

func (*ConfigV1) MarshalToSizedBuffer Uses

func (m *ConfigV1) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigV1) ProtoMessage Uses

func (*ConfigV1) ProtoMessage()

func (*ConfigV1) Reset Uses

func (m *ConfigV1) Reset()

func (*ConfigV1) Size Uses

func (m *ConfigV1) Size() (n int)

func (*ConfigV1) String Uses

func (m *ConfigV1) String() string

func (*ConfigV1) Unmarshal Uses

func (m *ConfigV1) Unmarshal(dAtA []byte) error

func (*ConfigV1) XXX_DiscardUnknown Uses

func (m *ConfigV1) XXX_DiscardUnknown()

func (*ConfigV1) XXX_Marshal Uses

func (m *ConfigV1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigV1) XXX_Merge Uses

func (m *ConfigV1) XXX_Merge(src proto.Message)

func (*ConfigV1) XXX_Size Uses

func (m *ConfigV1) XXX_Size() int

func (*ConfigV1) XXX_Unmarshal Uses

func (m *ConfigV1) XXX_Unmarshal(b []byte) error

type ConfigV2 Uses

type ConfigV2 struct {
    ActiveContext        string              `protobuf:"bytes,1,opt,name=active_context,json=activeContext,proto3" json:"active_context,omitempty"`
    Contexts             map[string]*Context `protobuf:"bytes,2,rep,name=contexts,proto3" json:"contexts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Metrics              bool                `protobuf:"varint,3,opt,name=metrics,proto3" json:"metrics,omitempty"`
    XXX_NoUnkeyedLiteral struct{}            `json:"-"`
    XXX_unrecognized     []byte              `json:"-"`
    XXX_sizecache        int32               `json:"-"`
}

ConfigV2 specifies v2 of the pachyderm config (June 2019 - present)

func (*ConfigV2) Descriptor Uses

func (*ConfigV2) Descriptor() ([]byte, []int)

func (*ConfigV2) GetActiveContext Uses

func (m *ConfigV2) GetActiveContext() string

func (*ConfigV2) GetContexts Uses

func (m *ConfigV2) GetContexts() map[string]*Context

func (*ConfigV2) GetMetrics Uses

func (m *ConfigV2) GetMetrics() bool

func (*ConfigV2) Marshal Uses

func (m *ConfigV2) Marshal() (dAtA []byte, err error)

func (*ConfigV2) MarshalTo Uses

func (m *ConfigV2) MarshalTo(dAtA []byte) (int, error)

func (*ConfigV2) MarshalToSizedBuffer Uses

func (m *ConfigV2) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigV2) ProtoMessage Uses

func (*ConfigV2) ProtoMessage()

func (*ConfigV2) Reset Uses

func (m *ConfigV2) Reset()

func (*ConfigV2) Size Uses

func (m *ConfigV2) Size() (n int)

func (*ConfigV2) String Uses

func (m *ConfigV2) String() string

func (*ConfigV2) Unmarshal Uses

func (m *ConfigV2) Unmarshal(dAtA []byte) error

func (*ConfigV2) XXX_DiscardUnknown Uses

func (m *ConfigV2) XXX_DiscardUnknown()

func (*ConfigV2) XXX_Marshal Uses

func (m *ConfigV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigV2) XXX_Merge Uses

func (m *ConfigV2) XXX_Merge(src proto.Message)

func (*ConfigV2) XXX_Size Uses

func (m *ConfigV2) XXX_Size() int

func (*ConfigV2) XXX_Unmarshal Uses

func (m *ConfigV2) XXX_Unmarshal(b []byte) error

type Context Uses

type Context struct {
    // Where this context came from
    Source ContextSource `protobuf:"varint,1,opt,name=source,proto3,enum=config.ContextSource" json:"source,omitempty"`
    // The hostname or IP address pointing pachd at a pachyderm cluster.
    PachdAddress string `protobuf:"bytes,2,opt,name=pachd_address,json=pachdAddress,proto3" json:"pachd_address,omitempty"`
    // Trusted root certificates (overrides installed certificates), formatted
    // as base64-encoded PEM
    ServerCAs string `protobuf:"bytes,3,opt,name=server_cas,json=serverCas,proto3" json:"server_cas,omitempty"`
    // A secret token identifying the current pachctl user within their
    // pachyderm cluster. This is included in all RPCs sent by pachctl, and used
    // to determine if pachctl actions are authorized.
    SessionToken string `protobuf:"bytes,4,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"`
    // The currently active transaction for batching together pachctl commands.
    // This can be set or cleared via many of the `pachctl * transaction` commands.
    // This is the ID of the transaction object stored in the pachyderm etcd.
    ActiveTransaction string `protobuf:"bytes,5,opt,name=active_transaction,json=activeTransaction,proto3" json:"active_transaction,omitempty"`
    // The k8s cluster name - used to construct a k8s context
    ClusterName string `protobuf:"bytes,6,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"`
    // The k8s auth info - used to construct a k8s context
    AuthInfo string `protobuf:"bytes,7,opt,name=auth_info,json=authInfo,proto3" json:"auth_info,omitempty"`
    // The k8s namespace - used to construct a k8s context
    Namespace            string   `protobuf:"bytes,8,opt,name=namespace,proto3" json:"namespace,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*Context) Descriptor Uses

func (*Context) Descriptor() ([]byte, []int)

func (*Context) GetActiveTransaction Uses

func (m *Context) GetActiveTransaction() string

func (*Context) GetAuthInfo Uses

func (m *Context) GetAuthInfo() string

func (*Context) GetClusterName Uses

func (m *Context) GetClusterName() string

func (*Context) GetNamespace Uses

func (m *Context) GetNamespace() string

func (*Context) GetPachdAddress Uses

func (m *Context) GetPachdAddress() string

func (*Context) GetServerCAs Uses

func (m *Context) GetServerCAs() string

func (*Context) GetSessionToken Uses

func (m *Context) GetSessionToken() string

func (*Context) GetSource Uses

func (m *Context) GetSource() ContextSource

func (*Context) Marshal Uses

func (m *Context) Marshal() (dAtA []byte, err error)

func (*Context) MarshalTo Uses

func (m *Context) MarshalTo(dAtA []byte) (int, error)

func (*Context) MarshalToSizedBuffer Uses

func (m *Context) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Context) ProtoMessage Uses

func (*Context) ProtoMessage()

func (*Context) Reset Uses

func (m *Context) Reset()

func (*Context) Size Uses

func (m *Context) Size() (n int)

func (*Context) String Uses

func (m *Context) String() string

func (*Context) Unmarshal Uses

func (m *Context) Unmarshal(dAtA []byte) error

func (*Context) XXX_DiscardUnknown Uses

func (m *Context) XXX_DiscardUnknown()

func (*Context) XXX_Marshal Uses

func (m *Context) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Context) XXX_Merge Uses

func (m *Context) XXX_Merge(src proto.Message)

func (*Context) XXX_Size Uses

func (m *Context) XXX_Size() int

func (*Context) XXX_Unmarshal Uses

func (m *Context) XXX_Unmarshal(b []byte) error

type ContextSource Uses

type ContextSource int32
const (
    ContextSource_NONE      ContextSource = 0
    ContextSource_CONFIG_V1 ContextSource = 1
    ContextSource_HUB       ContextSource = 2
)

func (ContextSource) EnumDescriptor Uses

func (ContextSource) EnumDescriptor() ([]byte, []int)

func (ContextSource) String Uses

func (x ContextSource) String() string

Package config imports 14 packages (graph) and is imported by 8 packages. Updated 2019-09-16. Refresh now. Tools for package owners.