rc_protocol

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: ISC Imports: 15 Imported by: 0

README

rc-protocol

Go Report Card Go Doc Release

Golang implementation of the rc-protocol

This module is used to build Golang remote-control servers and clients.

Install

TBD

Documentation

Index

Constants

View Source
const AUTH_HEADER_NAME = "authorization"
View Source
const ISO_8601_FORMAT = "2006-01-02T15:04:05-0700"

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	CreateSig(name string, keyDir string) (string, error)
	CheckSig(header string, certDir string) (bool, error)
	GetHeaderName() string
	ParseHeader(header string) []string
}

type Message

type Message struct {
	Id      int            `json:"id"`
	Command string         `json:"command"`
	Options MessageOptions `json:"options"`
}

type MessageOptions added in v0.1.1

type MessageOptions struct {
	Cwd     string            `json:"cwd"`
	Timeout int               `json:"timeout"`
	Env     map[string]string `json:"env"`
}

type RCProtocol

type RCProtocol interface {
	Message(json string) Message
	Response(json string) Response
	Auth
}

func NewRCProtocol

func NewRCProtocol() RCProtocol

type Response

type Response struct {
	Id       string `json:"id"`
	Stdout   string `json:"stdout"`
	Stderr   string `json:"stderr"`
	ExitCode int    `json:"exitCode"`
	Signal   string `json:"signal"`
}

Jump to

Keyboard shortcuts

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