Documentation ¶
Overview ¶
Package k8stopo implements topo.Server with the Kubernetes API as the backend.
We expect the following behavior from the kubernetes client library:
- TODO
We follow these conventions within this package:
- TODO
Index ¶
- func VersionFromInt(version int64) topo.Version
- type Factory
- type KubernetesVersion
- type NodeReference
- type Server
- func (s *Server) Close()
- func (s *Server) Create(ctx context.Context, filePath string, contents []byte) (topo.Version, error)
- func (s *Server) Delete(ctx context.Context, filePath string, version topo.Version) error
- func (s *Server) Get(ctx context.Context, filePath string) ([]byte, topo.Version, error)
- func (s *Server) List(ctx context.Context, filePathPrefix string) ([]topo.KVInfo, error)
- func (s *Server) ListDir(ctx context.Context, dirPath string, full bool) ([]topo.DirEntry, error)
- func (s *Server) Lock(ctx context.Context, dirPath, contents string) (topo.LockDescriptor, error)
- func (s *Server) NewLeaderParticipation(name, id string) (topo.LeaderParticipation, error)
- func (s *Server) TryLock(ctx context.Context, dirPath, contents string) (topo.LockDescriptor, error)
- func (s *Server) Update(ctx context.Context, filePath string, contents []byte, version topo.Version) (topo.Version, error)
- func (s *Server) Watch(ctx context.Context, filePath string) (*topo.WatchData, <-chan *topo.WatchData, error)
- func (s *Server) WatchRecursive(_ context.Context, path string) ([]*topo.WatchDataRecursive, <-chan *topo.WatchDataRecursive, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VersionFromInt ¶
VersionFromInt is used by old-style functions to create a proper Version: if version is -1, returns nil. Otherwise returns the KubernetesVersion object.
Types ¶
type Factory ¶
type Factory struct{}
Factory is the Kubernetes topo.Factory implementation.
func (Factory) HasGlobalReadOnlyCell ¶
HasGlobalReadOnlyCell is part of the topo.Factory interface.
type KubernetesVersion ¶
type KubernetesVersion string
KubernetesVersion is Kubernetes's idea of a version. It implements topo.Version.
func (KubernetesVersion) String ¶
func (v KubernetesVersion) String() string
String is part of the topo.Version interface.
type NodeReference ¶
type NodeReference struct {
// contains filtered or unexported fields
}
NodeReference contains the data relating to a node
func (*NodeReference) ToData ¶
func (n *NodeReference) ToData() vtv1beta1.VitessTopoNodeData
ToData converts a nodeReference to the data type used in the VitessTopoNode
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the implementation of topo.Server for Kubernetes.
func (*Server) Create ¶
func (s *Server) Create(ctx context.Context, filePath string, contents []byte) (topo.Version, error)
Create is part of the topo.Conn interface.
func (*Server) ListDir ¶
ListDir is part of the topo.Conn interface. It uses an internal cache to find all the objects matching a specific key and returns a slice of results sorted alphabetically to emulate the behavior of etcd, zk, consul, etc
func (*Server) NewLeaderParticipation ¶ added in v0.13.0
func (s *Server) NewLeaderParticipation(name, id string) (topo.LeaderParticipation, error)
NewLeaderParticipation is part of the topo.Server interface
func (*Server) TryLock ¶ added in v0.16.0
func (s *Server) TryLock(ctx context.Context, dirPath, contents string) (topo.LockDescriptor, error)
TryLock is part of the topo.Conn interface. Its implementation is same as Lock
func (*Server) Update ¶
func (s *Server) Update(ctx context.Context, filePath string, contents []byte, version topo.Version) (topo.Version, error)
Update is part of the topo.Conn interface.
func (*Server) Watch ¶
func (s *Server) Watch(ctx context.Context, filePath string) (*topo.WatchData, <-chan *topo.WatchData, error)
Watch is part of the topo.Conn interface.
func (*Server) WatchRecursive ¶ added in v0.15.0
func (s *Server) WatchRecursive(_ context.Context, path string) ([]*topo.WatchDataRecursive, <-chan *topo.WatchDataRecursive, error)
WatchRecursive is part of the topo.Conn interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
apis
|
|
client
|
|
clientset/versioned
This package has the automatically generated clientset.
|
This package has the automatically generated clientset. |
clientset/versioned/fake
This package has the automatically generated fake clientset.
|
This package has the automatically generated fake clientset. |
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
|
This package contains the scheme of the automatically generated clientset. |
clientset/versioned/typed/topo/v1beta1
This package has the automatically generated typed clients.
|
This package has the automatically generated typed clients. |
clientset/versioned/typed/topo/v1beta1/fake
Package fake has the automatically generated clients.
|
Package fake has the automatically generated clients. |