nmp

package
v0.0.0-...-963e4b2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 70

Documentation

Index

Constants

View Source
const (
	NMP_OP_READ      = 0
	NMP_OP_READ_RSP  = 1
	NMP_OP_WRITE     = 2
	NMP_OP_WRITE_RSP = 3
)
View Source
const (
	NMP_ERR_OK       = 0
	NMP_ERR_EUNKNOWN = 1
	NMP_ERR_ENOMEM   = 2
	NMP_ERR_EINVAL   = 3
	NMP_ERR_ETIMEOUT = 4
	NMP_ERR_ENOENT   = 5
)
View Source
const (
	NMP_GROUP_DEFAULT = 0
	NMP_GROUP_IMAGE   = 1
	NMP_GROUP_STAT    = 2
	NMP_GROUP_CONFIG  = 3
	NMP_GROUP_LOG     = 4
	NMP_GROUP_CRASH   = 5
	NMP_GROUP_SPLIT   = 6
	NMP_GROUP_RUN     = 7
	NMP_GROUP_FS      = 8
	NMP_GROUP_SHELL   = 9
	NMP_GROUP_PERUSER = 64
)
View Source
const (
	NMP_ID_DEF_ECHO           = 0
	NMP_ID_DEF_CONS_ECHO_CTRL = 1
	NMP_ID_DEF_TASKSTAT       = 2
	NMP_ID_DEF_MPSTAT         = 3
	NMP_ID_DEF_DATETIME_STR   = 4
	NMP_ID_DEF_RESET          = 5
)

Default group (0).

View Source
const (
	NMP_ID_IMAGE_STATE    = 0
	NMP_ID_IMAGE_UPLOAD   = 1
	NMP_ID_IMAGE_CORELIST = 3
	NMP_ID_IMAGE_CORELOAD = 4
	NMP_ID_IMAGE_ERASE    = 5
)

Image group (1).

View Source
const (
	NMP_ID_STAT_READ = 0
	NMP_ID_STAT_LIST = 1
)

Stat group (2).

View Source
const (
	NMP_ID_LOG_SHOW        = 0
	NMP_ID_LOG_CLEAR       = 1
	NMP_ID_LOG_APPEND      = 2
	NMP_ID_LOG_MODULE_LIST = 3
	NMP_ID_LOG_LEVEL_LIST  = 4
	NMP_ID_LOG_LIST        = 5
)

Log group (4).

View Source
const (
	NMP_ID_RUN_TEST = 0
	NMP_ID_RUN_LIST = 1
)

Run group (7).

View Source
const (
	LEVEL_DEBUG    int = 0
	LEVEL_INFO         = 1
	LEVEL_WARN         = 2
	LEVEL_ERROR        = 3
	LEVEL_CRITICAL     = 4
	/* Upto 7 custom loglevels */
	LEVEL_MAX = 255
)
View Source
const (
	STREAM_LOG  int = 0
	MEMORY_LOG      = 1
	STORAGE_LOG     = 2
)
View Source
const (
	MODULE_DEFAULT     int = 0
	MODULE_OS              = 1
	MODULE_NEWTMGR         = 2
	MODULE_NIMBLE_CTLR     = 3
	MODULE_NIMBLE_HOST     = 4
	MODULE_NFFS            = 5
	MODULE_REBOOT          = 6
	MODULE_TEST            = 8
	MODULE_MAX             = 255
)
View Source
const (
	LOG_ENTRY_TYPE_STRING LogEntryType = 0
	LOG_ENTRY_TYPE_CBOR                = 1
	LOG_ENTRY_TYPE_BINARY              = 2
)
View Source
const NMP_HDR_SIZE = 8
View Source
const (
	NMP_ID_CONFIG_VAL = 0
)

Config group (3).

View Source
const (
	NMP_ID_CRASH_TRIGGER = 0
)

Crash group (5).

View Source
const (
	NMP_ID_FS_FILE = 0
)

File system group (8).

View Source
const (
	NMP_ID_SHELL_EXEC = 0
)

Shell group (8).

Variables

View Source
var LogEntryTypeStringMap = map[LogEntryType]string{
	LOG_ENTRY_TYPE_STRING: "str",
	LOG_ENTRY_TYPE_CBOR:   "cbor",
	LOG_ENTRY_TYPE_BINARY: "bin",
}
View Source
var LogLevelNameMap = map[int]string{
	LEVEL_DEBUG:    "DEBUG",
	LEVEL_INFO:     "INFO",
	LEVEL_WARN:     "WARN",
	LEVEL_ERROR:    "ERROR",
	LEVEL_CRITICAL: "CRITICAL",
}
View Source
var LogModuleNameMap = map[int]string{
	MODULE_DEFAULT:     "DEFAULT",
	MODULE_OS:          "OS",
	MODULE_NEWTMGR:     "NEWTMGR",
	MODULE_NIMBLE_CTLR: "NIMBLE_CTLR",
	MODULE_NIMBLE_HOST: "NIMBLE_HOST",
	MODULE_NFFS:        "NFFS",
	MODULE_REBOOT:      "REBOOT",
	MODULE_TEST:        "TEST",
}
View Source
var LogTypeNameMap = map[int]string{
	STREAM_LOG:  "STREAM",
	MEMORY_LOG:  "MEMORY",
	STORAGE_LOG: "STORAGE",
}

Functions

func BodyBytes

func BodyBytes(body interface{}) ([]byte, error)

func EncodeNmpPlain

func EncodeNmpPlain(nmr *NmpMsg) ([]byte, error)

func LogEntryTypeToString

func LogEntryTypeToString(LogType LogEntryType) string

func LogLevelToString

func LogLevelToString(lm int) string

func LogModuleToString

func LogModuleToString(lm int) string

func LogTypeToString

func LogTypeToString(lm int) string

func RegisterResponseHandler

func RegisterResponseHandler(ogi Ogi, f rspCtor)

Types

type ConfigReadReq

type ConfigReadReq struct {
	NmpBase `codec:"-"`
	Name    string `codec:"name"`
}

func NewConfigReadReq

func NewConfigReadReq() *ConfigReadReq

func (*ConfigReadReq) Msg

func (r *ConfigReadReq) Msg() *NmpMsg

type ConfigReadRsp

type ConfigReadRsp struct {
	NmpBase
	Rc  int    `codec:"rc"`
	Val string `codec:"val"`
}

func NewConfigReadRsp

func NewConfigReadRsp() *ConfigReadRsp

func (*ConfigReadRsp) Msg

func (r *ConfigReadRsp) Msg() *NmpMsg

type ConfigWriteReq

type ConfigWriteReq struct {
	NmpBase `codec:"-"`
	Name    string `codec:"name,omitempty"`
	Val     string `codec:"val,omitempty"`
	Save    bool   `codec:"save,omitempty"`
}

func NewConfigWriteReq

func NewConfigWriteReq() *ConfigWriteReq

func (*ConfigWriteReq) Msg

func (r *ConfigWriteReq) Msg() *NmpMsg

type ConfigWriteRsp

type ConfigWriteRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewConfigWriteRsp

func NewConfigWriteRsp() *ConfigWriteRsp

func (*ConfigWriteRsp) Msg

func (r *ConfigWriteRsp) Msg() *NmpMsg

type CoreEraseReq

type CoreEraseReq struct {
	NmpBase `codec:"-"`
}

func NewCoreEraseReq

func NewCoreEraseReq() *CoreEraseReq

func (*CoreEraseReq) Msg

func (r *CoreEraseReq) Msg() *NmpMsg

type CoreEraseRsp

type CoreEraseRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewCoreEraseRsp

func NewCoreEraseRsp() *CoreEraseRsp

func (*CoreEraseRsp) Msg

func (r *CoreEraseRsp) Msg() *NmpMsg

type CoreListReq

type CoreListReq struct {
	NmpBase `codec:"-"`
}

func NewCoreListReq

func NewCoreListReq() *CoreListReq

func (*CoreListReq) Msg

func (r *CoreListReq) Msg() *NmpMsg

type CoreListRsp

type CoreListRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewCoreListRsp

func NewCoreListRsp() *CoreListRsp

func (*CoreListRsp) Msg

func (r *CoreListRsp) Msg() *NmpMsg

type CoreLoadReq

type CoreLoadReq struct {
	NmpBase `codec:"-"`
	Off     uint32 `codec:"off"`
}

func NewCoreLoadReq

func NewCoreLoadReq() *CoreLoadReq

func (*CoreLoadReq) Msg

func (r *CoreLoadReq) Msg() *NmpMsg

type CoreLoadRsp

type CoreLoadRsp struct {
	NmpBase
	Rc   int    `codec:"rc"`
	Off  uint32 `codec:"off"`
	Len  uint32 `codec:"len"`
	Data []byte `codec:"data"`
}

func NewCoreLoadRsp

func NewCoreLoadRsp() *CoreLoadRsp

func (*CoreLoadRsp) Msg

func (r *CoreLoadRsp) Msg() *NmpMsg

type CrashReq

type CrashReq struct {
	NmpBase   `codec:"-"`
	CrashType string `codec:"t"`
}

func NewCrashReq

func NewCrashReq() *CrashReq

func (*CrashReq) Msg

func (r *CrashReq) Msg() *NmpMsg

type CrashRsp

type CrashRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewCrashRsp

func NewCrashRsp() *CrashRsp

func (*CrashRsp) Msg

func (r *CrashRsp) Msg() *NmpMsg

type DateTimeReadReq

type DateTimeReadReq struct {
	NmpBase `codec:"-"`
}

func NewDateTimeReadReq

func NewDateTimeReadReq() *DateTimeReadReq

func (*DateTimeReadReq) Msg

func (r *DateTimeReadReq) Msg() *NmpMsg

type DateTimeReadRsp

type DateTimeReadRsp struct {
	NmpBase
	DateTime string `codec:"datetime"`
	Rc       int    `codec:"rc"`
}

func NewDateTimeReadRsp

func NewDateTimeReadRsp() *DateTimeReadRsp

func (*DateTimeReadRsp) Msg

func (r *DateTimeReadRsp) Msg() *NmpMsg

type DateTimeWriteReq

type DateTimeWriteReq struct {
	NmpBase  `codec:"-"`
	DateTime string `codec:"datetime"`
}

func NewDateTimeWriteReq

func NewDateTimeWriteReq() *DateTimeWriteReq

func (*DateTimeWriteReq) Msg

func (r *DateTimeWriteReq) Msg() *NmpMsg

type DateTimeWriteRsp

type DateTimeWriteRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewDateTimeWriteRsp

func NewDateTimeWriteRsp() *DateTimeWriteRsp

func (*DateTimeWriteRsp) Msg

func (r *DateTimeWriteRsp) Msg() *NmpMsg

type Dispatcher

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

The dispatcher is the owner of the listeners it points to. Only the dispatcher writes to these listeners.

func NewDispatcher

func NewDispatcher(logDepth int) *Dispatcher

func (*Dispatcher) AddListener

func (d *Dispatcher) AddListener(seq uint8) (*Listener, error)

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(data []byte) bool

Returns true if the response was dispatched.

func (*Dispatcher) DispatchRsp

func (d *Dispatcher) DispatchRsp(r NmpRsp) bool

Returns true if the response was dispatched.

func (*Dispatcher) ErrorAll

func (d *Dispatcher) ErrorAll(err error)

func (*Dispatcher) ErrorOne

func (d *Dispatcher) ErrorOne(seq uint8, err error) error

func (*Dispatcher) RemoveListener

func (d *Dispatcher) RemoveListener(seq uint8) *Listener

type EchoReq

type EchoReq struct {
	NmpBase `codec:"-"`
	Payload string `codec:"d"`
}

func NewEchoReq

func NewEchoReq() *EchoReq

func (*EchoReq) Msg

func (r *EchoReq) Msg() *NmpMsg

type EchoRsp

type EchoRsp struct {
	NmpBase
	Payload string `codec:"r"`
	Rc      int    `codec:"rc"`
}

func NewEchoRsp

func NewEchoRsp() *EchoRsp

func (*EchoRsp) Msg

func (r *EchoRsp) Msg() *NmpMsg

type FsDownloadReq

type FsDownloadReq struct {
	NmpBase `codec:"-"`
	Name    string `codec:"name"`
	Off     uint32 `codec:"off"`
}

func NewFsDownloadReq

func NewFsDownloadReq() *FsDownloadReq

func (*FsDownloadReq) Msg

func (r *FsDownloadReq) Msg() *NmpMsg

type FsDownloadRsp

type FsDownloadRsp struct {
	NmpBase
	Rc   int    `codec:"rc"`
	Off  uint32 `codec:"off"`
	Len  uint32 `codec:"len"`
	Data []byte `codec:"data"`
}

func NewFsDownloadRsp

func NewFsDownloadRsp() *FsDownloadRsp

func (*FsDownloadRsp) Msg

func (r *FsDownloadRsp) Msg() *NmpMsg

type FsUploadReq

type FsUploadReq struct {
	NmpBase `codec:"-"`
	Name    string `codec:"name"`
	Len     uint32 `codec:"len"`
	Off     uint32 `codec:"off"`
	Data    []byte `codec:"data"`
}

func NewFsUploadReq

func NewFsUploadReq() *FsUploadReq

func (*FsUploadReq) Msg

func (r *FsUploadReq) Msg() *NmpMsg

type FsUploadRsp

type FsUploadRsp struct {
	NmpBase
	Rc  int    `codec:"rc"`
	Off uint32 `codec:"off"`
}

func NewFsUploadRsp

func NewFsUploadRsp() *FsUploadRsp

func (*FsUploadRsp) Msg

func (r *FsUploadRsp) Msg() *NmpMsg

type ImageEraseReq

type ImageEraseReq struct {
	NmpBase `codec:"-"`
}

func NewImageEraseReq

func NewImageEraseReq() *ImageEraseReq

func (*ImageEraseReq) Msg

func (r *ImageEraseReq) Msg() *NmpMsg

type ImageEraseRsp

type ImageEraseRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewImageEraseRsp

func NewImageEraseRsp() *ImageEraseRsp

func (*ImageEraseRsp) Msg

func (r *ImageEraseRsp) Msg() *NmpMsg

type ImageStateEntry

type ImageStateEntry struct {
	NmpBase
	Image     int    `codec:"image"`
	Slot      int    `codec:"slot"`
	Version   string `codec:"version"`
	Hash      []byte `codec:"hash"`
	Bootable  bool   `codec:"bootable"`
	Pending   bool   `codec:"pending"`
	Confirmed bool   `codec:"confirmed"`
	Active    bool   `codec:"active"`
	Permanent bool   `codec:"permanent"`
}

type ImageStateReadReq

type ImageStateReadReq struct {
	NmpBase `codec:"-"`
}

func NewImageStateReadReq

func NewImageStateReadReq() *ImageStateReadReq

func (*ImageStateReadReq) Msg

func (r *ImageStateReadReq) Msg() *NmpMsg

type ImageStateRsp

type ImageStateRsp struct {
	NmpBase
	Rc          int               `codec:"rc"`
	Images      []ImageStateEntry `codec:"images"`
	SplitStatus SplitStatus       `codec:"splitStatus"`
}

func NewImageStateRsp

func NewImageStateRsp() *ImageStateRsp

func (*ImageStateRsp) Msg

func (r *ImageStateRsp) Msg() *NmpMsg

type ImageStateWriteReq

type ImageStateWriteReq struct {
	NmpBase `codec:"-"`
	Hash    []byte `codec:"hash"`
	Confirm bool   `codec:"confirm"`
}

func NewImageStateWriteReq

func NewImageStateWriteReq() *ImageStateWriteReq

func (*ImageStateWriteReq) Msg

func (r *ImageStateWriteReq) Msg() *NmpMsg

type ImageUploadReq

type ImageUploadReq struct {
	NmpBase  `codec:"-"`
	ImageNum uint8  `codec:"image"`
	Off      uint32 `codec:"off"`
	Len      uint32 `codec:"len,omitempty"`
	DataSha  []byte `codec:"sha,omitempty"`
	Upgrade  bool   `codec:"upgrade,omitempty"`
	Data     []byte `codec:"data"`
}

func NewImageUploadReq

func NewImageUploadReq() *ImageUploadReq

func NewImageUploadReqWithSeq

func NewImageUploadReqWithSeq(seq uint8) *ImageUploadReq

func (*ImageUploadReq) Msg

func (r *ImageUploadReq) Msg() *NmpMsg

type ImageUploadRsp

type ImageUploadRsp struct {
	NmpBase
	Rc  int    `codec:"rc"`
	Off uint32 `codec:"off"`
}

func NewImageUploadRsp

func NewImageUploadRsp() *ImageUploadRsp

func (*ImageUploadRsp) Msg

func (r *ImageUploadRsp) Msg() *NmpMsg

type Listener

type Listener struct {
	RspChan chan NmpRsp
	ErrChan chan error
	// contains filtered or unexported fields
}

func NewListener

func NewListener() *Listener

func (*Listener) AfterTimeout

func (nl *Listener) AfterTimeout(tmo time.Duration) <-chan time.Time

func (*Listener) Close

func (nl *Listener) Close()

type LogClearReq

type LogClearReq struct {
	NmpBase `codec:"-"`
}

func NewLogClearReq

func NewLogClearReq() *LogClearReq

func (*LogClearReq) Msg

func (r *LogClearReq) Msg() *NmpMsg

type LogClearRsp

type LogClearRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewLogClearRsp

func NewLogClearRsp() *LogClearRsp

func (*LogClearRsp) Msg

func (r *LogClearRsp) Msg() *NmpMsg

type LogEntry

type LogEntry struct {
	Index     uint32       `codec:"index"`
	Timestamp int64        `codec:"ts"`
	Module    uint8        `codec:"module"`
	Level     uint8        `codec:"level"`
	Type      LogEntryType `codec:"type"`
	ImgHash   []byte       `codec:"imghash"`
	Msg       []byte       `codec:"msg"`
}

type LogEntryType

type LogEntryType int

func LogEntryTypeFromString

func LogEntryTypeFromString(s string) (LogEntryType, error)

func (LogEntryType) MarshalBinary

func (l LogEntryType) MarshalBinary() ([]byte, error)

func (LogEntryType) String

func (l LogEntryType) String() string

func (*LogEntryType) UnmarshalBinary

func (l *LogEntryType) UnmarshalBinary(data []byte) error

type LogLevelListReq

type LogLevelListReq struct {
	NmpBase `codec:"-"`
}

func NewLogLevelListReq

func NewLogLevelListReq() *LogLevelListReq

func (*LogLevelListReq) Msg

func (r *LogLevelListReq) Msg() *NmpMsg

type LogLevelListRsp

type LogLevelListRsp struct {
	NmpBase
	Rc  int            `codec:"rc"`
	Map map[string]int `codec:"level_map"`
}

func NewLogLevelListRsp

func NewLogLevelListRsp() *LogLevelListRsp

func (*LogLevelListRsp) Msg

func (r *LogLevelListRsp) Msg() *NmpMsg

type LogListReq

type LogListReq struct {
	NmpBase `codec:"-"`
}

func NewLogListReq

func NewLogListReq() *LogListReq

func (*LogListReq) Msg

func (r *LogListReq) Msg() *NmpMsg

type LogListRsp

type LogListRsp struct {
	NmpBase
	Rc   int      `codec:"rc"`
	List []string `codec:"log_list"`
}

func NewLogListRsp

func NewLogListRsp() *LogListRsp

func (*LogListRsp) Msg

func (r *LogListRsp) Msg() *NmpMsg

type LogModuleListReq

type LogModuleListReq struct {
	NmpBase `codec:"-"`
}

func NewLogModuleListReq

func NewLogModuleListReq() *LogModuleListReq

func (*LogModuleListReq) Msg

func (r *LogModuleListReq) Msg() *NmpMsg

type LogModuleListRsp

type LogModuleListRsp struct {
	NmpBase
	Rc  int            `codec:"rc"`
	Map map[string]int `codec:"module_map"`
}

func NewLogModuleListRsp

func NewLogModuleListRsp() *LogModuleListRsp

func (*LogModuleListRsp) Msg

func (r *LogModuleListRsp) Msg() *NmpMsg

type LogShowLog

type LogShowLog struct {
	Name    string     `codec:"name"`
	Type    int        `codec:"type"`
	Entries []LogEntry `codec:"entries"`
}

type LogShowReq

type LogShowReq struct {
	NmpBase   `codec:"-"`
	Name      string `codec:"log_name"`
	Timestamp int64  `codec:"ts"`
	Index     uint32 `codec:"index"`
}

func NewLogShowReq

func NewLogShowReq() *LogShowReq

func (*LogShowReq) Msg

func (r *LogShowReq) Msg() *NmpMsg

type LogShowRsp

type LogShowRsp struct {
	NmpBase
	Rc        int          `codec:"rc" codec:",omitempty"`
	NextIndex uint32       `codec:"next_index"`
	Logs      []LogShowLog `codec:"logs"`
}

func NewLogShowRsp

func NewLogShowRsp() *LogShowRsp

func (*LogShowRsp) Msg

func (r *LogShowRsp) Msg() *NmpMsg

type MempoolStatReq

type MempoolStatReq struct {
	NmpBase `codec:"-"`
}

func NewMempoolStatReq

func NewMempoolStatReq() *MempoolStatReq

func (*MempoolStatReq) Msg

func (r *MempoolStatReq) Msg() *NmpMsg

type MempoolStatRsp

type MempoolStatRsp struct {
	NmpBase
	Rc     int                       `codec:"rc"`
	Mpools map[string]map[string]int `codec:"mpools"`
}

func NewMempoolStatRsp

func NewMempoolStatRsp() *MempoolStatRsp

func (*MempoolStatRsp) Msg

func (r *MempoolStatRsp) Msg() *NmpMsg

type NmpBase

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

func (*NmpBase) Hdr

func (b *NmpBase) Hdr() *NmpHdr

func (*NmpBase) SetHdr

func (b *NmpBase) SetHdr(h *NmpHdr)

type NmpHdr

type NmpHdr struct {
	Op    uint8 /* 3 bits of opcode */
	Flags uint8
	Len   uint16
	Group uint16
	Seq   uint8
	Id    uint8
}

func DecodeNmpHdr

func DecodeNmpHdr(data []byte) (*NmpHdr, error)

func (*NmpHdr) Bytes

func (hdr *NmpHdr) Bytes() []byte

type NmpMsg

type NmpMsg struct {
	Hdr  NmpHdr
	Body interface{}
}

func MsgFromReq

func MsgFromReq(r NmpReq) *NmpMsg

func NewNmpMsg

func NewNmpMsg() *NmpMsg

type NmpReq

type NmpReq interface {
	Hdr() *NmpHdr
	SetHdr(hdr *NmpHdr)

	Msg() *NmpMsg
}

Combine req + rsp.

type NmpRsp

type NmpRsp interface {
	Hdr() *NmpHdr
	SetHdr(msg *NmpHdr)

	Msg() *NmpMsg
}

func DecodeRspBody

func DecodeRspBody(hdr *NmpHdr, body []byte) (NmpRsp, error)

type Ogi

type Ogi struct {
	Op    uint8
	Group uint16
	Id    uint8
}

Op-Group-Id

type Reassembler

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

func NewReassembler

func NewReassembler() *Reassembler

func (*Reassembler) RxFrag

func (r *Reassembler) RxFrag(frag []byte) []byte

type ResetReq

type ResetReq struct {
	NmpBase `codec:"-"`
}

func NewResetReq

func NewResetReq() *ResetReq

func (*ResetReq) Msg

func (r *ResetReq) Msg() *NmpMsg

type ResetRsp

type ResetRsp struct {
	NmpBase
}

func NewResetRsp

func NewResetRsp() *ResetRsp

func (*ResetRsp) Msg

func (r *ResetRsp) Msg() *NmpMsg

type RunListReq

type RunListReq struct {
	NmpBase `codec:"-"`
}

func NewRunListReq

func NewRunListReq() *RunListReq

func (*RunListReq) Msg

func (r *RunListReq) Msg() *NmpMsg

type RunListRsp

type RunListRsp struct {
	NmpBase
	Rc   int      `codec:"rc"`
	List []string `codec:"run_list"`
}

func NewRunListRsp

func NewRunListRsp() *RunListRsp

func (*RunListRsp) Msg

func (r *RunListRsp) Msg() *NmpMsg

type RunTestReq

type RunTestReq struct {
	NmpBase  `codec:"-"`
	Testname string `codec:"testname"`
	Token    string `codec:"token"`
}

func NewRunTestReq

func NewRunTestReq() *RunTestReq

func (*RunTestReq) Msg

func (r *RunTestReq) Msg() *NmpMsg

type RunTestRsp

type RunTestRsp struct {
	NmpBase
	Rc int `codec:"rc"`
}

func NewRunTestRsp

func NewRunTestRsp() *RunTestRsp

func (*RunTestRsp) Msg

func (r *RunTestRsp) Msg() *NmpMsg

type ShellExecReq

type ShellExecReq struct {
	NmpBase `codec:"-"`
	Argv    []string `codec:"argv"`
}

func NewShellExecReq

func NewShellExecReq() *ShellExecReq

func (*ShellExecReq) Msg

func (r *ShellExecReq) Msg() *NmpMsg

type ShellExecRsp

type ShellExecRsp struct {
	NmpBase `codec:"-"`
	O       string `codec:"o"`
	Rc      int    `codec:"rc"`
}

func NewShellExecRsp

func NewShellExecRsp() *ShellExecRsp

func (*ShellExecRsp) Msg

func (r *ShellExecRsp) Msg() *NmpMsg

type SplitStatus

type SplitStatus int
const (
	NOT_APPLICABLE SplitStatus = iota
	NOT_MATCHING
	MATCHING
)

func (SplitStatus) String

func (sm SplitStatus) String() string

returns the enum as a string

type StatListReq

type StatListReq struct {
	NmpBase `codec:"-"`
}

func NewStatListReq

func NewStatListReq() *StatListReq

func (*StatListReq) Msg

func (r *StatListReq) Msg() *NmpMsg

type StatListRsp

type StatListRsp struct {
	NmpBase
	Rc   int      `codec:"rc"`
	List []string `codec:"stat_list"`
}

func NewStatListRsp

func NewStatListRsp() *StatListRsp

func (*StatListRsp) Msg

func (r *StatListRsp) Msg() *NmpMsg

type StatReadReq

type StatReadReq struct {
	NmpBase `codec:"-"`
	Name    string `codec:"name"`
}

func NewStatReadReq

func NewStatReadReq() *StatReadReq

func (*StatReadReq) Msg

func (r *StatReadReq) Msg() *NmpMsg

type StatReadRsp

type StatReadRsp struct {
	NmpBase
	Rc     int                    `codec:"rc"`
	Name   string                 `codec:"name"`
	Group  string                 `codec:"group"`
	Fields map[string]interface{} `codec:"fields"`
}

func NewStatReadRsp

func NewStatReadRsp() *StatReadRsp

func (*StatReadRsp) Msg

func (r *StatReadRsp) Msg() *NmpMsg

type TaskStatReq

type TaskStatReq struct {
	NmpBase `codec:"-"`
}

func NewTaskStatReq

func NewTaskStatReq() *TaskStatReq

func (*TaskStatReq) Msg

func (r *TaskStatReq) Msg() *NmpMsg

type TaskStatRsp

type TaskStatRsp struct {
	NmpBase
	Rc    int                       `codec:"rc"`
	Tasks map[string]map[string]int `codec:"tasks"`
}

func NewTaskStatRsp

func NewTaskStatRsp() *TaskStatRsp

func (*TaskStatRsp) Msg

func (r *TaskStatRsp) Msg() *NmpMsg

Jump to

Keyboard shortcuts

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