v0.2.0 Latest Latest

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

Go to latest
Published: Jan 6, 2016 License: MPL-2.0 Imports: 17 Imported by: 10




This section is empty.


This section is empty.


func Register

func Register(server *rpc.Server, thing interface{}) (name string, err error)

Register registers an Otto thing with the RPC server and returns the name it is registered under.


type App

type App struct {
	Broker *muxBroker
	Client *rpc.Client
	Name   string

App is an implementation of app.App that communicates over RPC.

func (*App) Build

func (c *App) Build(ctx *app.Context) error

func (*App) Close

func (c *App) Close() error

func (*App) Compile

func (c *App) Compile(ctx *app.Context) (*app.CompileResult, error)

func (*App) Deploy

func (c *App) Deploy(ctx *app.Context) error

func (*App) Dev

func (c *App) Dev(ctx *app.Context) error

func (*App) DevDep

func (c *App) DevDep(dst, src *app.Context) (*app.DevDep, error)

func (*App) Implicit

func (c *App) Implicit(ctx *app.Context) (*appfile.File, error)

func (*App) Meta

func (c *App) Meta() (*app.Meta, error)

type AppCompileResponse

type AppCompileResponse struct {
	Result *app.CompileResult
	Error  *BasicError

type AppContextArgs

type AppContextArgs struct {

	Context *app.Context

type AppDevDepArgs

type AppDevDepArgs struct {
	ContextDst       *app.Context
	ContextDstShared ContextSharedArgs
	ContextSrc       *app.Context
	ContextSrcShared ContextSharedArgs

type AppDevDepResponse

type AppDevDepResponse struct {
	Result *app.DevDep
	Error  *BasicError

type AppFunc

type AppFunc func() app.App

AppFunc creates app.App when they're requested from the server.

type AppImplicitResponse

type AppImplicitResponse struct {
	Result *appfile.File
	Error  *BasicError

type AppMetaResponse

type AppMetaResponse struct {
	Result *app.Meta
	Error  *BasicError

type AppServer

type AppServer struct {
	Broker *muxBroker
	App    app.App

AppServer is a net/rpc compatible structure for serving an App. This should not be used directly.

func (*AppServer) Build

func (s *AppServer) Build(
	args *AppContextArgs,
	reply *AppSimpleResponse) error

func (*AppServer) Compile

func (s *AppServer) Compile(
	args *AppContextArgs,
	reply *AppCompileResponse) error

func (*AppServer) Deploy

func (s *AppServer) Deploy(
	args *AppContextArgs,
	reply *AppSimpleResponse) error

func (*AppServer) Dev

func (s *AppServer) Dev(
	args *AppContextArgs,
	reply *AppSimpleResponse) error

func (*AppServer) DevDep

func (s *AppServer) DevDep(
	args *AppDevDepArgs,
	reply *AppDevDepResponse) error

func (*AppServer) Implicit

func (s *AppServer) Implicit(
	args *AppContextArgs,
	reply *AppImplicitResponse) error

func (*AppServer) Meta

func (s *AppServer) Meta(
	args *struct{},
	reply *AppMetaResponse) error

type AppSimpleResponse

type AppSimpleResponse struct {
	Error *BasicError

type BasicError

type BasicError struct {
	Message string

This is a type that wraps error types so that they can be messaged across RPC channels. Since "error" is an interface, we can't always gob-encode the underlying structure. This is a valid error interface implementer that we will push across.

func NewBasicError

func NewBasicError(err error) *BasicError

func (*BasicError) Error

func (e *BasicError) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields

Client connects to a Server in order to request plugin implementations for Otto.

func Dial

func Dial(network, address string) (*Client, error)

Dial opens a connection to an RPC server and returns a client.

func NewClient

func NewClient(conn io.ReadWriteCloser) (*Client, error)

NewClient creates a client from an already-open connection-like value. Dial is typically used instead.

func (*Client) App

func (c *Client) App() (app.App, error)

func (*Client) Close

func (c *Client) Close() error

Close closes the connection. The client is no longer usable after this is called.

func (*Client) SyncStreams

func (c *Client) SyncStreams(stdout io.Writer, stderr io.Writer) error

SyncStreams should be called to enable syncing of stdout, stderr with the plugin.

This will return immediately and the syncing will continue to happen in the background. You do not need to launch this in a goroutine itself.

This should never be called multiple times.

type ContextSharedArgs

type ContextSharedArgs struct {
	DirectoryId uint32
	UiId        uint32

ContextSharedArgs is a struct that should be embedded directly into args structs that contain a context. It will be populated with the IDs that can be used to communicate back to the interfaces.

type DirGetBlobArgs

type DirGetBlobArgs struct {
	Key string
	Id  uint32

type DirGetBlobResponse

type DirGetBlobResponse struct {
	Ok    bool
	Error *BasicError

type DirGetBuildResponse

type DirGetBuildResponse struct {
	Value *directory.Build
	Error *BasicError

type DirGetDeployResponse

type DirGetDeployResponse struct {
	Value *directory.Deploy
	Error *BasicError

type DirGetDevResponse

type DirGetDevResponse struct {
	Value *directory.Dev
	Error *BasicError

type DirGetInfraResponse

type DirGetInfraResponse struct {
	Value *directory.Infra
	Error *BasicError

type DirPutBlobArgs

type DirPutBlobArgs struct {
	Key string
	Id  uint32

type DirPutBuildResponse

type DirPutBuildResponse struct {
	Value *directory.Build
	Error *BasicError

type DirPutDeployResponse

type DirPutDeployResponse struct {
	Value *directory.Deploy
	Error *BasicError

type DirPutDevResponse

type DirPutDevResponse struct {
	Value *directory.Dev
	Error *BasicError

type DirPutInfraResponse

type DirPutInfraResponse struct {
	Value *directory.Infra
	Error *BasicError

type Directory

type Directory struct {
	Broker *muxBroker
	Client *rpc.Client
	Name   string

Directory is an implementatin of directory.Backend that communicates over RPC.

func (*Directory) DeleteDev

func (d *Directory) DeleteDev(v *directory.Dev) error

func (*Directory) GetBlob

func (d *Directory) GetBlob(key string) (*directory.BlobData, error)

func (*Directory) GetBuild

func (d *Directory) GetBuild(v *directory.Build) (*directory.Build, error)

func (*Directory) GetDeploy

func (d *Directory) GetDeploy(v *directory.Deploy) (*directory.Deploy, error)

func (*Directory) GetDev

func (d *Directory) GetDev(v *directory.Dev) (*directory.Dev, error)

func (*Directory) GetInfra

func (d *Directory) GetInfra(v *directory.Infra) (*directory.Infra, error)

func (*Directory) PutBlob

func (d *Directory) PutBlob(key string, data *directory.BlobData) error

func (*Directory) PutBuild

func (d *Directory) PutBuild(v *directory.Build) error

func (*Directory) PutDeploy

func (d *Directory) PutDeploy(v *directory.Deploy) error

func (*Directory) PutDev

func (d *Directory) PutDev(v *directory.Dev) error

func (*Directory) PutInfra

func (d *Directory) PutInfra(v *directory.Infra) error

type DirectoryServer

type DirectoryServer struct {
	Broker    *muxBroker
	Directory directory.Backend

DirectoryServer is a net/rpc compatible structure for serving a directory backend. This should not be used directly.

func (*DirectoryServer) DeleteDev

func (s *DirectoryServer) DeleteDev(
	args *directory.Dev,
	reply *ErrorResponse) error

func (*DirectoryServer) GetBlob

func (s *DirectoryServer) GetBlob(
	args *DirGetBlobArgs,
	reply *DirGetBlobResponse) error

func (*DirectoryServer) GetBuild

func (s *DirectoryServer) GetBuild(
	args *directory.Build,
	reply *DirGetBuildResponse) error

func (*DirectoryServer) GetDeploy

func (s *DirectoryServer) GetDeploy(
	args *directory.Deploy,
	reply *DirGetDeployResponse) error

func (*DirectoryServer) GetDev

func (s *DirectoryServer) GetDev(
	args *directory.Dev,
	reply *DirGetDevResponse) error

func (*DirectoryServer) GetInfra

func (s *DirectoryServer) GetInfra(
	args *directory.Infra,
	reply *DirGetInfraResponse) error

func (*DirectoryServer) PutBlob

func (s *DirectoryServer) PutBlob(
	args *DirPutBlobArgs,
	reply *ErrorResponse) error

func (*DirectoryServer) PutBuild

func (s *DirectoryServer) PutBuild(
	args *directory.Build,
	reply *DirPutBuildResponse) error

func (*DirectoryServer) PutDeploy

func (s *DirectoryServer) PutDeploy(
	args *directory.Deploy,
	reply *DirPutDeployResponse) error

func (*DirectoryServer) PutDev

func (s *DirectoryServer) PutDev(
	args *directory.Dev,
	reply *DirPutDevResponse) error

func (*DirectoryServer) PutInfra

func (s *DirectoryServer) PutInfra(
	args *directory.Infra,
	reply *DirPutInfraResponse) error

type ErrorResponse

type ErrorResponse struct {
	Error *BasicError

ErrorResponse is a basic response structure that can be used with the RPC layer to only return an error.

type Server

type Server struct {
	AppFunc AppFunc

	// Stdout, Stderr are what this server will use instead of the
	// normal stdin/out/err. This is because due to the multi-process nature
	// of our plugin system, we can't use the normal process values so we
	// make our own custom one we pipe across.
	Stdout io.Reader
	Stderr io.Reader

Server listens for network connections and then dispenses interface implementations over net/rpc.

func (*Server) Accept

func (s *Server) Accept(lis net.Listener)

Accept accepts connections on a listener and serves requests for each incoming connection. Accept blocks; the caller typically invokes it in a go statement.

func (*Server) ServeConn

func (s *Server) ServeConn(conn io.ReadWriteCloser)

ServeConn runs a single connection.

ServeConn blocks, serving the connection until the client hangs up.

type Ui

type Ui struct {
	Client *rpc.Client
	Name   string

Ui is an implementatin of ui.Ui that communicates over RPC.

func (*Ui) Header

func (i *Ui) Header(msg string)

func (*Ui) Input

func (i *Ui) Input(opts *ui.InputOpts) (string, error)

func (*Ui) Message

func (i *Ui) Message(msg string)

func (*Ui) Raw

func (i *Ui) Raw(msg string)

type UiInputResponse

type UiInputResponse struct {
	Value string
	Error *BasicError

type UiServer

type UiServer struct {
	Ui ui.Ui

UiServer is a net/rpc compatible structure for serving a Ui. This should not be used directly.

func (*UiServer) Header

func (s *UiServer) Header(msg string, reply *interface{}) error

func (*UiServer) Input

func (s *UiServer) Input(
	opts *ui.InputOpts,
	reply *UiInputResponse) error

func (*UiServer) Message

func (s *UiServer) Message(msg string, reply *interface{}) error

func (*UiServer) Raw

func (s *UiServer) Raw(msg string, reply *interface{}) error

Jump to

Keyboard shortcuts

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