client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, cfg *Configuration) (c *Client, err error)

func (*Client) AddCompletedLayers

func (c *Client) AddCompletedLayers(compressedLayerDigest string)

func (*Client) Close

func (c *Client) Close()

func (*Client) FindBaseImage

func (c *Client) FindBaseImage(base, ref string) (img containerd.Image, err error)

FindBaseImage find the closest available image for the requested image, if user appointed an image, then this function will be used for looking up the appointed image

func (*Client) GetFilesystemPath

func (c *Client) GetFilesystemPath(cd string) string

func (*Client) GetFilesystemRoot

func (c *Client) GetFilesystemRoot() string

func (*Client) GetMountingPoint

func (c *Client) GetMountingPoint(ssId string) string

func (*Client) InitCLIServer

func (c *Client) InitCLIServer() (err error)

func (*Client) InitSnapshotter

func (c *Client) InitSnapshotter() (err error)

InitSnapshotter initializes the snapshotter service

func (*Client) LoadImage

func (c *Client) LoadImage(manifest digest.Digest) (manager *Manager, err error)

func (*Client) Mount

func (c *Client) Mount(md, ld, ssId string, sn *snapshots.Info) (mnt string, err error)

Mount returns the mountpoint for the given snapshot - md: manifest digest - ld: uncompressed layer digest - ssId: snapshot id

func (*Client) PullImage

func (c *Client) PullImage(base containerd.Image, ref, platform, proxyCfg string, ready *chan bool) (img containerd.Image, err error)

func (*Client) StartCLIServer

func (c *Client) StartCLIServer()

func (*Client) StartSnapshotter

func (c *Client) StartSnapshotter()

StartSnapshotter starts the snapshotter service, should be run in a goroutine

func (*Client) Unmount

func (c *Client) Unmount(cd, sn string) error

func (*Client) UploadTraces

func (c *Client) UploadTraces(proxyCfg string, tc *fs.TraceCollection) error

type Configuration

type Configuration struct {
	LogLevel string `json:"log_level"`
	ClientId string `json:"id"`

	// path to database
	Metadata string `json:"metadata"`

	// socket address
	Socket     string `json:"socket"`
	DaemonType string `json:"daemon_type"`
	Daemon     string `json:"daemon"`
	Containerd string `json:"containerd"`
	Namespace  string `json:"default_namespace"`
	TracesDir  string `json:"traces_dir"`

	// registry + proxy
	DefaultProxy   string `json:"default_proxy"`
	FileSystemRoot string `json:"fs_root"`

	Proxies map[string]*ProxyConfig `json:"configs"`
}

func LoadConfig

func LoadConfig(cfgPath string) (c *Configuration, p string, n bool, error error)

func NewConfig

func NewConfig() *Configuration

func (*Configuration) SaveConfig

func (c *Configuration) SaveConfig() error

type Manager

type Manager struct {
	receive.DeltaBundle
	// contains filtered or unexported fields
}

Manager should be unmarshalled from a json file and then Populate() should be called to populate other fields

func (*Manager) CreateSnapshots

func (m *Manager) CreateSnapshots(c *Client) (err error)

func (*Manager) Extract

func (m *Manager) Extract(r *io.ReadCloser) error

func (*Manager) GetPathByLayer

func (m *Manager) GetPathByLayer(stack int64) string

func (*Manager) Init

func (m *Manager) Init(cfg *Configuration, ready bool,
	manifest *v1.Manifest, imageConfig *v1.Image, manifestDigest digest.Digest)

Init populates the manager with the necessary information and data structures. Use json.Unmarshal to unmarshal the json file from data storage into a Manager struct. - ready: if set to false, we will then use Extract() to get the content of the file - cfg: configuration of the client - image, manifest, imageConfig: information about the image (maybe we don't need this)

func (*Manager) LogTrace

func (m *Manager) LogTrace(stack int64, filename string, access, complete time.Time)

func (*Manager) LookUpFile

func (m *Manager) LookUpFile(stack int64, filename string) fs.ReceivedFile

func (*Manager) NewStarlightFS

func (m *Manager) NewStarlightFS(mount string, stack int64, options *fusefs.Options, debug bool) (f *fs.Instance, err error)

NewStarlightFS creates FUSE server and mount to provided mount directory

func (*Manager) PrepareDirectories

func (m *Manager) PrepareDirectories(c *Client) error

func (*Manager) SetOptimizerOff

func (m *Manager) SetOptimizerOff() (err error)

func (*Manager) SetOptimizerOn

func (m *Manager) SetOptimizerOn(optimizeGroup string) (err error)

func (*Manager) String

func (m *Manager) String() string

func (*Manager) Teardown

func (m *Manager) Teardown()

type ProxyConfig

type ProxyConfig struct {
	Protocol string `json:"protocol"`
	Address  string `json:"address"`

	// Auth
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

func ParseProxyStrings

func ParseProxyStrings(v string) (name string, c *ProxyConfig, err error)

type StarlightDaemonAPIServer

type StarlightDaemonAPIServer struct {
	pb.UnimplementedDaemonServer
	// contains filtered or unexported fields
}

func (*StarlightDaemonAPIServer) AddProxyProfile

func (s *StarlightDaemonAPIServer) AddProxyProfile(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)

func (*StarlightDaemonAPIServer) PullImage

func (*StarlightDaemonAPIServer) ReportTraces

func (*StarlightDaemonAPIServer) SetOptimizer

func (*StarlightDaemonAPIServer) Version

func (s *StarlightDaemonAPIServer) Version(ctx context.Context, req *pb.Request) (*pb.Version, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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