protocol

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package protocol 解析从 sctl 权威 schema 生成并嵌入的协议元数据。

Index

Constants

This section is empty.

Variables

View Source
var DefinitionJSON []byte

DefinitionJSON is the sole maintained protocol definition embedded directly from protocol.json.

Functions

This section is empty.

Types

type Action

type Action struct {
	Scope    string `json:"scope"`
	Write    bool   `json:"-"`
	Effect   string `json:"effect"`
	Blocking string `json:"blocking,omitempty"`
	Params   string `json:"params"`
	Result   string `json:"result"`
}

type Crypto

type Crypto struct {
	MAC        string            `json:"mac"`
	KDF        string            `json:"kdf"`
	AEAD       string            `json:"aead"`
	NonceBytes int               `json:"nonceBytes"`
	Encoding   string            `json:"encoding"`
	Context    map[string]string `json:"context"`
}

type Limits

type Limits struct {
	AuthTimeoutMs       int `json:"authTimeoutMs"`
	WriteDecisionTtlMs  int `json:"writeDecisionTtlMs"`
	ExtPairingCodeTtlMs int `json:"extPairingCodeTtlMs"`
	MaxSourceBytes      int `json:"maxSourceBytes"`
	MaxFrameBytes       int `json:"maxFrameBytes"`
	PingIntervalMs      int `json:"pingIntervalMs"`
}

type PairingCode

type PairingCode struct {
	Alphabet string `json:"alphabet"`
	Length   int    `json:"length"`
	Display  string `json:"display"`
}

type Protocol

type Protocol struct {
	JSONRPCVersion string            `json:"jsonrpc"`
	SchemaVersion  string            `json:"schemaVersion"`
	Transport      Transport         `json:"transport"`
	SessionMethods []string          `json:"sessionMethods"`
	Scopes         []string          `json:"scopes"`
	Actions        map[string]Action `json:"methods"`
	ErrorCodes     []string          `json:"errorCodes"`
	Crypto         Crypto            `json:"crypto"`
	Limits         Limits            `json:"limits"`
	PairingCode    PairingCode       `json:"pairingCode"`
}

func Load

func Load() (*Protocol, error)

Load 解析内嵌的 protocol.json,只解析一次。

type Transport

type Transport struct {
	DefaultURL  string `json:"defaultUrl"`
	DefaultPort int    `json:"defaultPort"`
	Frame       string `json:"frame"`
}

Directories

Path Synopsis
Code generated by protocolgen; DO NOT EDIT.
Code generated by protocolgen; DO NOT EDIT.

Jump to

Keyboard shortcuts

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