sysboxFsGrpc

package
v0.0.0-...-8ab58c1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMountpoint

func GetMountpoint() (string, error)

func SendContainerPreRegistration

func SendContainerPreRegistration(data *ContainerData) (err error)

Pre-registers container creation in sysbox-fs. Notice that this is a blocking call that can potentially have a minor impact on container's boot-up speed.

func SendContainerRegistration

func SendContainerRegistration(data *ContainerData) (err error)

Registers container creation in sysbox-fs.

func SendContainerUnregistration

func SendContainerUnregistration(data *ContainerData) (err error)

Unregisters container from sysbox-fs.

func SendContainerUpdate

func SendContainerUpdate(data *ContainerData) (err error)

Sends a container-update message to sysbox-fs end. At this point, we are only utilizing this message for a particular case, update the container creation-time attribute, but this function can serve more general purposes in the future.

Types

type Callback

type Callback func(client interface{}, c *ContainerData) error

type CallbacksMap

type CallbacksMap = map[MessageType]Callback

type ContainerData

type ContainerData struct {
	Id            string
	Netns         string
	InitPid       int32
	Hostname      string
	Ctime         time.Time
	UidFirst      int32
	UidSize       int32
	GidFirst      int32
	GidSize       int32
	ProcRoPaths   []string
	ProcMaskPaths []string
}

Container info passed by the client to the server across the grpc channel

type MessageType

type MessageType uint16
const (
	Unknown MessageType = iota
	ContainerPreRegisterMessage
	ContainerRegisterMessage
	ContainerUnregisterMessage
	ContainerUpdateMessage
	GetMountpointMessage
	MaxSupportedMessage
)

type Server

type Server struct {
	Ctx       interface{}
	Callbacks CallbacksMap
	FuseMp    string
}

func NewServer

func NewServer(ctx interface{}, cb *CallbacksMap, fuseMp string) *Server

func (*Server) CallbackRegister

func (s *Server) CallbackRegister(c *Callback)

TODO: To be implemented in the future if needed.

func (*Server) CallbackUnregister

func (s *Server) CallbackUnregister(c *Callback)

TODO: To be implemented in the future if needed.

func (*Server) ContainerPreRegistration

func (s *Server) ContainerPreRegistration(
	ctx context.Context, data *pb.ContainerData) (*pb.Response, error)

func (*Server) ContainerRegistration

func (s *Server) ContainerRegistration(
	ctx context.Context, data *pb.ContainerData) (*pb.Response, error)

func (*Server) ContainerUnregistration

func (s *Server) ContainerUnregistration(
	ctx context.Context, data *pb.ContainerData) (*pb.Response, error)

func (*Server) ContainerUpdate

func (s *Server) ContainerUpdate(
	ctx context.Context, data *pb.ContainerData) (*pb.Response, error)

func (*Server) GetAddr

func (s *Server) GetAddr() string

func (*Server) GetMountpoint

func (s *Server) GetMountpoint(
	ctx context.Context, req *pb.MountpointReq) (*pb.MountpointResp, error)

func (*Server) Init

func (s *Server) Init() error

Jump to

Keyboard shortcuts

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