mlptest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mlptest 提供 Pinax Cloud Sync MLP REST 合同的内存 HTTP 测试服务端。

它忠实实现 pinax-cloud-sync-mlp 公开路由(vault_id 术语、bootstrap、vault create/link、 changes cursor、blob batch-check/sign-upload/upload/download、revision CAS commit), 让 CLI 侧的 server transport push/pull、两设备收敛与冲突测试通过真实 HTTP 跑通, 而不依赖尚未实现的 Pinax Cloud 后端。

测试服务端不保存明文 note body:blob 只存加密 envelope。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BootstrapToken string
	SessionToken   string
	AccountID      string
	VaultID        string
	CryptoMode     string
}

Config 配置 MLP 测试服务端。

type Server

type Server struct {
	*httptest.Server
	// contains filtered or unexported fields
}

Server 是内存 MLP 测试服务端。

func New

func New(cfg Config) *Server

New 启动一台内存 MLP 测试服务端。调用方用完应 Close。

func (*Server) Endpoint

func (s *Server) Endpoint() string

Endpoint 返回服务端地址。

func (*Server) ExpireBlobPlanForTest

func (s *Server) ExpireBlobPlanForTest(vaultID, blobID string)

func (*Server) Token

func (s *Server) Token() string

Token 返回 bootstrap 后颁发的会话 token(测试用于构造 cloudclient.Config.Token)。

Jump to

Keyboard shortcuts

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