nsm

package
v0.0.0-...-f9aeb4d Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerAnnounce        = "/nsm/server/announce"
	ClientOpen            = "/nsm/client/open"
	ClientSave            = "/nsm/client/save"
	ClientIsDirty         = "/nsm/client/is_dirty"
	ClientIsClean         = "/nsm/client/is_clean"
	ClientSessionLoaded   = "/nsm/client/session_is_loaded"
	ClientShowOptionalGui = "/nsm/client/show_optional_gui"
	ClientHideOptionalGui = "/nsm/client/hide_optional_gui"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Osc        *osc.Client
	Server     string
	Servername string
	State      ClientState
	Error      error
	// contains filtered or unexported fields
}

func NewClient

func NewClient(name string, opts ...Option) (*Client, error)

func (*Client) HasCapability

func (c *Client) HasCapability(cap ClientCapability) bool

func (*Client) ServerHasCapability

func (c *Client) ServerHasCapability(cap ServerCapability) bool

func (*Client) SetDirty

func (c *Client) SetDirty(dirty bool)

type ClientCapability

type ClientCapability string
const (
	CapabilityClientSwitch      ClientCapability = "switch"
	CapabilityClientDirty       ClientCapability = "dirty"
	CapabilityClientProgress    ClientCapability = "progress"
	CapabilityClientMessage     ClientCapability = "message"
	CapabilityClientOptionalGUI ClientCapability = "optional-gui"
)

type ClientState

type ClientState int
const (
	StateInitializing ClientState = iota
	StateConnecting
	StateConnected
	StateError
)

type Error

type Error struct {
	Code ErrorCode
	Msg  string
}

func NewError

func NewError(code ErrorCode, msg string) *Error

func (*Error) Error

func (e *Error) Error() string

type ErrorCode

type ErrorCode int
const (
	ErrGeneral         ErrorCode = -1
	ErrIncompatibleAPI ErrorCode = -2
	ErrBlacklisted     ErrorCode = -3
	ErrLaunchFailed    ErrorCode = -4
	ErrNoSuchFile      ErrorCode = -5
	ErrNoSessionOpen   ErrorCode = -6
	ErrUnsavedChanges  ErrorCode = -7
	ErrNotNow          ErrorCode = -8
	ErrBadProject      ErrorCode = -9
	ErrCreateFailed    ErrorCode = -10
)

type Option

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

func SetOpenHandler

func SetOpenHandler(handler func(projectPath, displayName, clientID string) error) Option

func SetOptCapabilities

func SetOptCapabilities(caps ...ClientCapability) Option

func SetSaveHandler

func SetSaveHandler(handler func() error) Option

func SetSessionLoadedHandler

func SetSessionLoadedHandler(handler func()) Option

func SetShowGuiHandler

func SetShowGuiHandler(handler func(bool)) Option

type OptionCapabilities

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

type OptionOpenHandler

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

type OptionSaveHandler

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

type OptionSessionLoadedHandler

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

type OptionShowGuiHandler

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

type ServerCapability

type ServerCapability string
const (
	CapabilityServerControl     ServerCapability = "server_control"
	CapabilityServerBroadcast   ServerCapability = "broadcast"
	CapabilityServerOptionalGui ServerCapability = "optional-gui"
)

Jump to

Keyboard shortcuts

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