editor

package
v12.0.0-...-09a2066 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2017 License: MIT, MIT, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 4444
)

Default values for the configuration

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Hostname if empty used the iris server's hostname
	Hostname string
	// Port if 0 4444
	Port int
	// KeyFile the key file(ssl optional)
	KeyFile string
	// CertFile the cert file (ssl optional)
	CertFile string
	// WorkingDir if empty "./"
	WorkingDir string
	// Username defaults to empty, you should set this
	Username string
	// Password defaults to empty, you should set this
	Password string
	// DisableOutput set that to true if you don't care about alm-tools' messages
	// they are useful because that the default value is "false"
	DisableOutput bool
}

Config the configs for the Editor plugin

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configs for the Editor plugin

func (Config) Merge

func (c Config) Merge(cfg []Config) (config Config)

Merge merges the default with the given config and returns the result

func (Config) MergeSingle

func (c Config) MergeSingle(cfg Config) (config Config)

MergeSingle merges the default with the given config and returns the result

type Editor

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

Editor is the alm-tools adaptor.

It holds a logger from the iris' station username,password for basic auth directory which the client side code is keyfile,certfile for TLS listening and a host which is listening for

func New

func New(cfg ...Config) *Editor

New creates and returns an Editor Plugin instance

func (*Editor) Adapt

func (e *Editor) Adapt(frame *iris.Policies)

Adapt adapts the editor with Iris. Note: We use that method and not the return on New because we want to export the Editor's functionality to the user.

func (*Editor) Dir

func (e *Editor) Dir(workingDir string) *Editor

Dir sets the directory which the client side source code alive

func (*Editor) DisableOutput

func (e *Editor) DisableOutput()

DisableOutput call that if you don't care about alm-tools' messages they are useful because that the default configuration shows them

func (*Editor) GetDescription

func (e *Editor) GetDescription() string

GetDescription EditorPlugin is a bridge between Iris and the alm-tools, the browser-based IDE for client-side sources.

func (*Editor) Port

func (e *Editor) Port(port int) *Editor

Port sets the port (int) for the editor adaptor's standalone server

func (*Editor) SetEnable

func (e *Editor) SetEnable(enable bool)

SetEnable if true enables the editor adaptor, otherwise disables it

func (*Editor) User

func (e *Editor) User(username string, password string) *Editor

User set a user, accepts two parameters: username (string), string (string)

Jump to

Keyboard shortcuts

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