Package dosjson provides primitives for working with the Decred JSON-RPC API. When communicating via the JSON-RPC protocol, all of the commands need to be marshalled to and from the the wire in the appropriate format. This package provides data structures and primitives to ease this process. In addition, it also provides some additional features such as custom command registration, command categorization, and reflection-based help generation. This information is not necessary in order to use this package, but it does provide some intuition into what the marshalling and unmarshalling that is discussed below is doing under the hood. As defined by the JSON-RPC spec, there are effectively two forms of messages on the wire: Request Objects {"jsonrpc":"1.0","id":"SOMEID","method":"SOMEMETHOD","params":[SOMEPARAMS]} NOTE: Notifications are the same format except the id field is null. Response Objects {"result":SOMETHING,"error":null,"id":"SOMEID"} {"result":null,"error":{"code":SOMEINT,"message":SOMESTRING},"id":"SOMEID"} For requests, the params field can vary in what it contains depending on the method (a.k.a. command) being sent. Each parameter can be as simple as an int or a complex structure containing many nested fields. The id field is used to identify a request and will be included in the associated response. When working with asynchronous transports, such as websockets, spontaneous notifications are also possible. As indicated, they are the same as a request object, except they have the id field set to null. Therefore, servers will ignore requests with the id field set to null, while clients can choose to consume or ignore them. Unfortunately, the original Bitcoin JSON-RPC API (and hence anything compatible with it) doesn't always follow the spec and will sometimes return an error string in the result field with a null error for certain commands. However, for the most part, the error field will be set as described on failure. Based upon the discussion above, it should be easy to see how the types of this package map into the required parts of the protocol To simplify the marshalling of the requests and responses, the MarshalCmd and MarshalResponse functions are provided. They return the raw bytes ready to be sent across the wire. Unmarshalling a received Request object is a two step process: This approach is used since it provides the caller with access to the additional fields in the request that are not part of the command such as the ID. Unmarshalling a received Response object is also a two step process: As above, this approach is used since it provides the caller with access to the fields in the response such as the ID and Error. This package provides two approaches for creating a new command. This first, and preferred, method is to use one of the New<Foo>Cmd functions. This allows static compile-time checking to help ensure the parameters stay in sync with the struct definitions. The second approach is the NewCmd function which takes a method (command) name and variable arguments. The function includes full checking to ensure the parameters are accurate according to provided method, however these checks are, obviously, run-time which means any mistakes won't be found until the code is actually executed. However, it is quite useful for user-supplied commands that are intentionally dynamic. The command handling of this package is built around the concept of registered commands. This is true for the wide variety of commands already provided by the package, but it also means caller can easily provide custom commands with all of the same functionality as the built-in commands. Use the RegisterCmd function for this purpose. A list of all registered methods can be obtained with the RegisteredCmdMethods function. All registered commands are registered with flags that identify information such as whether the command applies to a chain server, wallet server, or is a notification along with the method name to use. These flags can be obtained with the MethodUsageFlags flags, and the method can be obtained with the CmdMethod function. To facilitate providing consistent help to users of the RPC server, this package exposes the GenerateHelp and function which uses reflection on registered commands or notifications, as well as the provided expected result types, to generate the final help text. In addition, the MethodUsageText function is provided to generate consistent one-line usage for registered commands and notifications using reflection. There are 2 distinct type of errors supported by this package: The first category of errors (type Error) typically indicates a programmer error and can be avoided by properly using the API. Errors of this type will be returned from the various functions available in this package. They identify issues such as unsupported field types, attempts to register malformed commands, and attempting to create a new command with an improper number of parameters. The specific reason for the error can be detected by type asserting it to a *dosjson.Error and accessing the ErrorCode field. The second category of errors (type RPCError), on the other hand, are useful for returning errors to RPC clients. Consequently, they are used in the previously described Response type. This example demonstrates how to unmarshal a JSON-RPC response and then unmarshal the result field in the response to a concrete type.
Package assert provides functions for making assertions in tests.
Package versine is the Versine SDK for AI agents: it signs assertions, verifies users and requests handshake codes.
agent-sdk-testify owns environments and process orchestration, never SDK assertions.
Package transportparity gives a test the ability to assert that two independently implemented transport doors (HTTP, MCP, ACP, ...) fronting the same underlying operation still agree on OUTCOME, without requiring them to agree on wire shape.
Package bencode implements bencoding of data as defined in BEP 3 using type assertion over reflection for performance.
package Miniassert is a small assert library.
Package timeline models the two parties (and their roles, counsel, and relationship) in a case, and assembles the chronological case timeline from extracted facts and statements, flagging conflicts where different parties assert incompatible claims about the same subject — so downstream IRAC (Issue/Rule/Application/Conclusion) reasoning has a structured "who said what happened, and when" view of the case to reason over.
* package gotcha contains a set of common test assertions.
Package samlidp makes the app a SAML 2.0 identity provider: other services (SAML service providers, "SPs") send their users here to sign in, and receive a signed assertion naming the user.
Package assert provides testify-compatible assertions with go-cmp equality.
Package expect provides testing.TB-style assertions for goav pipeline tests.
Package svgps validates a document against the SVG Tiny Portable/Secure profile, the format BIMI requires for the brand indicator published in the l= tag of an Assertion Record.
Package encryption provides the primitives and enforcement points Verdex uses to keep stored and transmitted data encrypted: TLS configuration for service traffic, an encryption-at-rest assertion for the database connection, authenticated field-level encryption for sensitive values, and a versioned envelope format that survives key rotation.
Package securitytesting is Phase 086: an adversarial validation harness proving this platform's defenses actually hold under attack, rather than merely asserting that they exist.
Package gosync provides Map, a generic concurrent map with the semantics of sync.Map and without its cost: no interface boxing of keys and values and no type assertions on the way out.
Package platformauth validates the Platform-Assertion JWT injected by the platform (docs/reference/assertion.md).
Package extensionprotocol defines request-bound identity assertions between a trusted Portal host and an independently deployed application backend.
Package assert 配合标准库 testing 使用的断言库
Package grounding verifies that every assertion in a synthesized packages/synthesisagent Opinion is actually grounded in the case's own facts and applicable law, rather than trusting a model's prose at face value.
Package vlatte holds what every vlatte mock server shares: mocks, scopes, matchers, delays, events, recipes and assertions.
Package st, pronounced "ghost", is a tiny test framework for making short, useful assertions in your Go tests.
Package hairspring is the Go SDK for Hairspring's guest event protocol v1 (docs/guest-protocol.md): in-source property assertions that an unmodified Linux program reports to the Hairspring engine.
Package saml is a SAML 2.0 service provider for the federated sign-in seam (pkg/auth/federated): a person signs in at an identity provider — Okta, Microsoft Entra ID, Google Workspace, Keycloak, Shibboleth, ADFS — and comes back to the application with a signed assertion.
Package sseparse is the zero-dependency SSE wire-format parser behind github.com/larsartmann/go-sse/ssetest: it implements the WHATWG HTML Living Standard § 9.2.6 event-stream interpretation, ships the assertion helpers that operate on parsed events, and exports the WPT conformance corpus as consumable data.
Package appleoracle exposes macOS's own libcompression so a test can ask the platform what the bytes should be, instead of asserting against bytes the implementation under test produced.
package expect contains various test assertion helpers.
Command assertfix rewrites stdlib table-test assertions into testkit/assert calls, as a go/analysis fixtool.
Package reqtest provides shared HTTP test mechanics: request building with an optional bearer and JSON body, a constructed client behind an httptest.Server, problem+json assertions, JSON body decoding, and async condition polling.