component

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 23 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTooManyBytesInResponse indicates too many bytes in a response message.
	ErrTooManyBytesInResponse = errors.New("too many bytes in a response")
	// ErrTooManyHandlesInResponse indicates too many handles in a response message.
	ErrTooManyHandlesInResponse = errors.New("too many handles in a response")
)

Functions

func GetStartupHandle

func GetStartupHandle(info HandleInfo) zx.Handle

func Serve

func Serve(ctx context.Context, stub fidl.Stub, req zx.Channel, opts ServeOptions)

Serve serves requests from req using stub.

opts contains behavior-modifying options.

Types

type Connector

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

func (*Connector) ConnectToEnvService

func (c *Connector) ConnectToEnvService(r fidl.ServiceRequest)

type Context

type Context struct {

	// OutgoingService is the directory served on the startup directory request.
	//
	// OutgoingService is cleared when BindStartupHandle is called to prevent further mutation which
	// is not supported by this implementation, though it is permitted by fuchsia.io.Directory.
	OutgoingService OutDirectory
	// contains filtered or unexported fields
}

func NewContextFromStartupInfo

func NewContextFromStartupInfo() *Context

NewContextFromStartupInfo connects to the service root directory and registers debug services.

func (*Context) BindStartupHandle

func (c *Context) BindStartupHandle(ctx fidl.Context)

BindStartupHandle takes the startup handle if it's not already taken and serves the out directory with all services that have been registered on (*Context).OutgoingService.

New services must not be added after BindStartupHandle is called.

BindStartupHandle blocks until the context is canceled.

func (*Context) ConnectToEnvService

func (c *Context) ConnectToEnvService(r fidl.ServiceRequest)

func (*Context) Connector

func (c *Context) Connector() *Connector

func (*Context) Environment

func (c *Context) Environment() *sys.EnvironmentWithCtxInterface

func (*Context) Launcher

func (c *Context) Launcher() *sys.LauncherWithCtxInterface

type Directory

type Directory interface {
	Get(string) (Node, bool)
	ForEach(func(string, Node))
}

type DirectoryWrapper

type DirectoryWrapper struct {
	Directory Directory
}

func (*DirectoryWrapper) GetDirectory

func (dir *DirectoryWrapper) GetDirectory() fidlio.DirectoryWithCtx

type File

type File interface {
	GetReader() (Reader, uint64)
	GetVMO() zx.VMO
}

type FileWrapper

type FileWrapper struct {
	File File
}

type HandleInfo

type HandleInfo struct {
	Type HandleType
	Arg  uint16
}

type HandleType

type HandleType uint16
const (
	HandleDirectoryRequest HandleType = 0x3B
	HandleAppServices      HandleType = 0x43

	HandleUser0 HandleType = 0xF0
	HandleUser1 HandleType = 0xF1
	HandleUser2 HandleType = 0xF2
)

type Node

type Node interface {
	// contains filtered or unexported methods
}

type OutDirectory

type OutDirectory mapDirectory

func (OutDirectory) AddDebug

func (od OutDirectory) AddDebug(name string, n Node)

func (OutDirectory) AddDiagnostics

func (od OutDirectory) AddDiagnostics(name string, n Node)

func (OutDirectory) AddService

func (od OutDirectory) AddService(name string, addFn func(context.Context, zx.Channel) error)

AddService registers a named handler in the outgoing service directory.

The handler function is called serially with each incoming request matching the name. It must not block, and is expected to handle incoming calls on the request.

type Reader

type Reader interface {
	io.Reader
	io.ReaderAt
	io.Seeker
}

type ServeOptions

type ServeOptions struct {
	// Concurrent controls if requests on the channel are handled concurrently or
	// serially.
	Concurrent bool
	// KeepChannelAlive controls if the channel is closed when Serve returns.
	KeepChannelAlive bool
	// OnError is a logging hook that will be called with errors that cannot be
	// propagated. Must be non-nil.
	OnError func(error)
}

ServeOptions contains options for Serve.

type Service

type Service struct {
	*fidlio.NodeWithCtxTransitionalBase // TODO(https://fxbug.dev/77623): Remove once transitions are complete.
	// AddFn is called serially with an incoming request. It must not block, and
	// is expected to handle incoming calls on the request.
	AddFn func(context.Context, zx.Channel) error
}

func (*Service) Clone

func (*Service) Close

func (*Service) Close(fidl.Context) (int32, error)

func (*Service) Close2

func (*Service) Describe

func (*Service) Describe(fidl.Context) (fidlio.NodeInfo, error)

func (*Service) GetAttr

func (*Service) NodeGetFlags

func (*Service) NodeGetFlags(fidl.Context) (int32, uint32, error)

func (*Service) NodeSetFlags

func (*Service) NodeSetFlags(_ fidl.Context, flags uint32) (int32, error)

func (*Service) SetAttr

func (*Service) SetAttr(_ fidl.Context, flags uint32, attributes fidlio.NodeAttributes) (int32, error)

func (*Service) Sync

func (*Service) Sync(fidl.Context) (int32, error)

Jump to

Keyboard shortcuts

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