vos

package module
v0.0.0-...-10e49fb Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

README

系统基础设施 - vos(Virtual Operating System)

  • 主体使用 GoLang 开发

架构

package 说明
vos 基础库
vos/vterm 虚拟终端
vos/example 实现 Demo
vos/fs 虚拟文件系统
vos/rt 内建脚本引擎

Task

  • vos

  • vos/vterm

  • vos/example

    • base
    • fs
    • script
  • vos/fs

  • vos/rt

  • 时间同步检查

Documentation

Index

Constants

View Source
const (
	SignLoginRetryTimes = "s_login_retry_times"
	SignHostname        = "s_hostname"
)

Syscall(s)

Variables

View Source
var (
	ErrSyscallError = errors.New("Syscall Error")
	ErrAuthProtocol = errors.New("Auth Protocol Error")

	ErrKeyError = errors.New("Key Error")
)

error(s)

View Source
var (
	PromptTpl, _ = template.New("Prompt").Parse(fmt.Sprintf("\n%s {{ .User }} @ {{ .Host }} in {{ .PWD }} [{{ .Time }}] {{ .Error }}", glog.Blue("#")))
	Prompt       = glog.Red("$") + " "
)

Prompt

Functions

func RsaDecrypt

func RsaDecrypt(priv *rsa.PrivateKey, cipher []byte) ([]byte, error)

RsaDecrypt - 解密

func RsaEncrypt

func RsaEncrypt(pub *rsa.PublicKey, origin []byte) ([]byte, error)

RsaEncrypt - 加密

func RsaPriv

func RsaPriv(privateKey []byte) (*rsa.PrivateKey, error)

RsaPriv Key

func RsaPub

func RsaPub(publicKey []byte) (*rsa.PublicKey, error)

RsaPub Key

func RsaSign

func RsaSign(priv *rsa.PrivateKey, text []byte) ([]byte, error)

RsaSign - 签名

func RsaVerify

func RsaVerify(pub *rsa.PublicKey, text []byte, sig []byte) error

RsaVerify - 验证

Types

type Base

type Base struct {
	*glog.Log

	Auth func(*auth.Auth, *auth.Result) (string, error)
	// contains filtered or unexported fields
}

Base VOS

func New

func New(exts ...Ext) *Base

New VOS

func (*Base) Accept

func (b *Base) Accept(conn net.Conn)

func (*Base) NewSession

func (b *Base) NewSession(fn func(*Session)) *Session

NewSession for Base-VOS

func (*Base) Start

func (b *Base) Start() error

Start Base-VOS

func (*Base) Syscall

func (b *Base) Syscall(args ...string) interface{}

Syscall of Base-VOS

type Ext

type Ext interface {
	Init(*Base) error
	Syscall(args ...string) interface{}
}

Ext of VOS

type Session

type Session struct {
	*glog.Log
	// contains filtered or unexported fields
}

Session of VOS

Directories

Path Synopsis
example
base command
pure command

Jump to

Keyboard shortcuts

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