Documentation
¶
Overview ¶
Package openrpc provides an ownership-safe OpenRPC document model and the core contracts shared by parsing, validation, resolution, and discovery.
Index ¶
- Variables
- func JSONSchemaToolsMetaSchema() []byte
- func MarshalCanonical(document Document) ([]byte, error)
- func MetaSchema() []byte
- func SupportedVersions() []string
- type Components
- func (components Components) ContentDescriptors() (map[string]ContentDescriptor, bool)
- func (components Components) Errors() (map[string]Error, bool)
- func (components Components) ExamplePairings() (map[string]ExamplePairing, bool)
- func (components Components) Examples() (map[string]Example, bool)
- func (components Components) Links() (map[string]Link, bool)
- func (components Components) Schemas() (map[string]jsonschema.Schema, bool)
- func (components Components) Tags() (map[string]Tag, bool)
- func (components Components) UnknownFields() Fields
- type ComponentsInput
- type Contact
- type ContactInput
- type ContentDescriptor
- func (descriptor ContentDescriptor) Deprecated() (bool, bool)
- func (descriptor ContentDescriptor) DeprecatedOrDefault() bool
- func (descriptor ContentDescriptor) Description() (string, bool)
- func (fields ContentDescriptor) Extensions() Fields
- func (descriptor ContentDescriptor) Name() string
- func (descriptor ContentDescriptor) Required() (bool, bool)
- func (descriptor ContentDescriptor) RequiredOrDefault() bool
- func (descriptor ContentDescriptor) Schema() jsonschema.Schema
- func (descriptor ContentDescriptor) Summary() (string, bool)
- func (fields ContentDescriptor) UnknownFields() Fields
- type ContentDescriptorInput
- type ContentDescriptorOrReference
- type Document
- func (document Document) Components() (Components, bool)
- func (document Document) EffectiveServers() []Server
- func (fields Document) Extensions() Fields
- func (document Document) ExternalDocs() (ExternalDocumentation, bool)
- func (document Document) Info() Info
- func (document Document) MethodCount() int
- func (document Document) Methods() []MethodOrReference
- func (document Document) SchemaURI() (string, bool)
- func (document Document) Servers() ([]Server, bool)
- func (fields Document) UnknownFields() Fields
- func (document Document) Version() Version
- type DocumentInput
- type Error
- type ErrorInput
- type ErrorOrReference
- type Example
- type ExampleInput
- type ExampleOrReference
- type ExamplePairing
- type ExamplePairingInput
- type ExamplePairingOrReference
- type ExternalDocumentation
- type ExternalDocumentationInput
- type Field
- type Fields
- type Info
- func (info Info) Contact() (Contact, bool)
- func (info Info) Description() (string, bool)
- func (fields Info) Extensions() Fields
- func (info Info) License() (License, bool)
- func (info Info) TermsOfService() (string, bool)
- func (info Info) Title() string
- func (fields Info) UnknownFields() Fields
- func (info Info) Version() string
- type InfoInput
- type Integer
- type License
- type LicenseInput
- type Link
- func (link Link) Description() (string, bool)
- func (fields Link) Extensions() Fields
- func (link Link) Method() (string, bool)
- func (link Link) Name() (jsonvalue.Value, bool)
- func (link Link) Params() (jsonvalue.Value, bool)
- func (link Link) Server() (Server, bool)
- func (link Link) Summary() (string, bool)
- func (fields Link) UnknownFields() Fields
- type LinkInput
- type LinkOrReference
- type Method
- func (method Method) Deprecated() (bool, bool)
- func (method Method) DeprecatedOrDefault() bool
- func (method Method) Description() (string, bool)
- func (method Method) Errors() ([]ErrorOrReference, bool)
- func (method Method) Examples() ([]ExamplePairingOrReference, bool)
- func (fields Method) Extensions() Fields
- func (method Method) ExternalDocs() (ExternalDocumentation, bool)
- func (method Method) Links() ([]LinkOrReference, bool)
- func (method Method) Name() string
- func (method Method) ParamStructure() (ParamStructure, bool)
- func (method Method) Params() []ContentDescriptorOrReference
- func (method Method) Result() (ContentDescriptorOrReference, bool)
- func (method Method) Servers() ([]Server, bool)
- func (method Method) Summary() (string, bool)
- func (method Method) Tags() ([]TagOrReference, bool)
- func (fields Method) UnknownFields() Fields
- type MethodInput
- type MethodOrReference
- type MissingRequiredFieldError
- type ParamStructure
- type Reference
- type Server
- func (server Server) Description() (string, bool)
- func (fields Server) Extensions() Fields
- func (server Server) Name() (string, bool)
- func (server Server) Summary() (string, bool)
- func (server Server) URL() string
- func (fields Server) UnknownFields() Fields
- func (server Server) Variables() (map[string]ServerVariable, bool)
- type ServerInput
- type ServerVariable
- type ServerVariableInput
- type Tag
- type TagInput
- type TagOrReference
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidExtensionName reports a specification extension without the // required case-sensitive x- prefix. ErrInvalidExtensionName = errors.New("openrpc: invalid extension name") // ErrDuplicateField reports repeated field input to an ownership-safe // constructor. ErrDuplicateField = errors.New("openrpc: duplicate field") // ErrInvalidField reports an empty name or invalid zero JSON value. ErrInvalidField = errors.New("openrpc: invalid field") )
var ( // ErrFieldCollision reports an extension or preserved unknown field whose // name collides with a standard field during serialization. ErrFieldCollision = errors.New("openrpc: field collision") // ErrInvalidUnion reports a zero or otherwise unselected union value. ErrInvalidUnion = errors.New("openrpc: invalid union value") )
var ErrInvalidInteger = errors.New("openrpc: invalid integer")
ErrInvalidInteger reports a non-canonical JSON integer lexeme.
var ErrInvalidParamStructure = errors.New("openrpc: invalid parameter structure")
ErrInvalidParamStructure reports a value outside the specification's closed parameter-structure set.
var ErrMissingRequiredField = errors.New("openrpc: missing required field")
ErrMissingRequiredField reports a required field absent from constructor input.
var ErrUnsupportedVersion = errors.New("openrpc: unsupported specification version")
ErrUnsupportedVersion reports a malformed, unsupported, or future OpenRPC specification version. Callers must not infer semantics for rejected values.
Functions ¶
func JSONSchemaToolsMetaSchema ¶
func JSONSchemaToolsMetaSchema() []byte
JSONSchemaToolsMetaSchema returns an owned copy of the companion meta-schema referenced by the authoritative OpenRPC 1.4.1 schema.
func MarshalCanonical ¶
MarshalCanonical serializes a Document deterministically. Object members are sorted lexically, insignificant whitespace is removed, and optional field presence is retained without materializing defaults.
func MetaSchema ¶
func MetaSchema() []byte
MetaSchema returns an owned copy of the authoritative pinned OpenRPC 1.4.1 Draft 7 meta-schema.
func SupportedVersions ¶
func SupportedVersions() []string
SupportedVersions returns the supported OpenRPC compatibility lines.
Types ¶
type Components ¶
type Components struct {
// contains filtered or unexported fields
}
Components is an immutable OpenRPC Components Object.
func NewComponents ¶
func NewComponents(input ComponentsInput) (Components, error)
NewComponents constructs an owned Components Object.
func (Components) ContentDescriptors ¶
func (components Components) ContentDescriptors() (map[string]ContentDescriptor, bool)
ContentDescriptors returns an owned optional descriptor component map.
func (Components) Errors ¶
func (components Components) Errors() (map[string]Error, bool)
Errors returns an owned optional error component map.
func (Components) ExamplePairings ¶
func (components Components) ExamplePairings() (map[string]ExamplePairing, bool)
ExamplePairings returns an owned optional example-pairing component map.
func (Components) Examples ¶
func (components Components) Examples() (map[string]Example, bool)
Examples returns an owned optional example component map.
func (Components) Links ¶
func (components Components) Links() (map[string]Link, bool)
Links returns an owned optional link component map.
func (Components) Schemas ¶
func (components Components) Schemas() (map[string]jsonschema.Schema, bool)
Schemas returns an owned optional schema component map.
func (Components) Tags ¶
func (components Components) Tags() (map[string]Tag, bool)
Tags returns an owned optional tag component map.
func (Components) UnknownFields ¶
func (components Components) UnknownFields() Fields
UnknownFields returns fields retained by preserving parse mode.
type ComponentsInput ¶
type ComponentsInput struct {
Schemas map[string]jsonschema.Schema
Links map[string]Link
Errors map[string]Error
Examples map[string]Example
ExamplePairings map[string]ExamplePairing
ContentDescriptors map[string]ContentDescriptor
Tags map[string]Tag
UnknownFields Fields
}
ComponentsInput supplies reusable Components maps. Nil means absent; an allocated empty map means explicitly present and empty.
type Contact ¶
type Contact struct {
// contains filtered or unexported fields
}
Contact is an immutable OpenRPC Contact Object.
func NewContact ¶
func NewContact(input ContactInput) (Contact, error)
NewContact constructs a Contact Object with owned optional values.
func (Contact) Extensions ¶
func (fields Contact) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Contact) UnknownFields ¶
func (fields Contact) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type ContactInput ¶
type ContactInput struct {
Name *string
Email *string
URL *string
Extensions Fields
UnknownFields Fields
}
ContactInput supplies optional Contact Object fields.
type ContentDescriptor ¶
type ContentDescriptor struct {
// contains filtered or unexported fields
}
ContentDescriptor is an immutable OpenRPC Content Descriptor Object.
func NewContentDescriptor ¶
func NewContentDescriptor(input ContentDescriptorInput) (ContentDescriptor, error)
NewContentDescriptor constructs a Content Descriptor Object.
func (ContentDescriptor) Deprecated ¶
func (descriptor ContentDescriptor) Deprecated() (bool, bool)
Deprecated returns the declared value and whether the field was present.
func (ContentDescriptor) DeprecatedOrDefault ¶
func (descriptor ContentDescriptor) DeprecatedOrDefault() bool
DeprecatedOrDefault returns the effective value, whose default is false.
func (ContentDescriptor) Description ¶
func (descriptor ContentDescriptor) Description() (string, bool)
Description returns the optional rich-text description.
func (ContentDescriptor) Extensions ¶
func (fields ContentDescriptor) Extensions() Fields
Extensions returns immutable specification extension fields.
func (ContentDescriptor) Name ¶
func (descriptor ContentDescriptor) Name() string
Name returns the required content name.
func (ContentDescriptor) Required ¶
func (descriptor ContentDescriptor) Required() (bool, bool)
Required returns the declared value and whether the field was present.
func (ContentDescriptor) RequiredOrDefault ¶
func (descriptor ContentDescriptor) RequiredOrDefault() bool
RequiredOrDefault returns the effective value, whose default is false.
func (ContentDescriptor) Schema ¶
func (descriptor ContentDescriptor) Schema() jsonschema.Schema
Schema returns the required Draft 7 schema.
func (ContentDescriptor) Summary ¶
func (descriptor ContentDescriptor) Summary() (string, bool)
Summary returns the optional short summary.
func (ContentDescriptor) UnknownFields ¶
func (fields ContentDescriptor) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type ContentDescriptorInput ¶
type ContentDescriptorInput struct {
Name string
Description *string
Summary *string
Schema *jsonschema.Schema
Required *bool
Deprecated *bool
Extensions Fields
UnknownFields Fields
}
ContentDescriptorInput supplies Content Descriptor Object fields.
type ContentDescriptorOrReference ¶
type ContentDescriptorOrReference struct {
// contains filtered or unexported fields
}
ContentDescriptorOrReference is the union permitted in OpenRPC document locations that accept a descriptor or reusable reference.
func ContentDescriptorReference ¶
func ContentDescriptorReference(value Reference) ContentDescriptorOrReference
ContentDescriptorReference constructs the reference union case.
func ContentDescriptorValue ¶
func ContentDescriptorValue(value ContentDescriptor) ContentDescriptorOrReference
ContentDescriptorValue constructs the descriptor union case.
func (ContentDescriptorOrReference) Descriptor ¶
func (value ContentDescriptorOrReference) Descriptor() (ContentDescriptor, bool)
Descriptor returns the descriptor case and true.
func (ContentDescriptorOrReference) Reference ¶
func (value ContentDescriptorOrReference) Reference() (Reference, bool)
Reference returns the reference case and true.
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an immutable OpenRPC root document.
func NewDocument ¶
func NewDocument(input DocumentInput) (Document, error)
NewDocument constructs an owned OpenRPC document.
func (Document) Components ¶
func (document Document) Components() (Components, bool)
Components returns the optional reusable Components Object.
func (Document) EffectiveServers ¶
EffectiveServers returns explicit non-empty servers or the specification's localhost default when servers are absent or empty.
func (Document) Extensions ¶
func (fields Document) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Document) ExternalDocs ¶
func (document Document) ExternalDocs() (ExternalDocumentation, bool)
ExternalDocs returns optional external documentation.
func (Document) MethodCount ¶
MethodCount returns the required method collection size without allocating an owned snapshot. It supports resource-policy checks before traversal.
func (Document) Methods ¶
func (document Document) Methods() []MethodOrReference
Methods returns an owned required method slice. It may be empty after context-aware security filtering.
func (Document) UnknownFields ¶
func (fields Document) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type DocumentInput ¶
type DocumentInput struct {
Version Version
SchemaURI *string
Info *Info
ExternalDocs *ExternalDocumentation
Servers []Server
HasServers bool
Methods []MethodOrReference
Components *Components
Extensions Fields
UnknownFields Fields
}
DocumentInput supplies root OpenRPC document fields. Info must be non-nil, and Methods must be non-nil even when the visible list is empty.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an immutable OpenRPC Error Object.
func NewError ¶
func NewError(input ErrorInput) (Error, error)
NewError constructs an Error Object without narrowing its integer code.
func (Error) Extensions ¶
func (fields Error) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Error) UnknownFields ¶
func (fields Error) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type ErrorInput ¶
type ErrorInput struct {
Code Integer
Message string
HasMessage bool
Data *jsonvalue.Value
Extensions Fields
UnknownFields Fields
}
ErrorInput supplies Error Object fields. Set HasMessage when representing a required but empty message.
type ErrorOrReference ¶
type ErrorOrReference struct {
// contains filtered or unexported fields
}
ErrorOrReference is an Error Object or Reference Object union.
func ErrorReference ¶
func ErrorReference(value Reference) ErrorOrReference
ErrorReference constructs the Reference Object union case.
func ErrorValue ¶
func ErrorValue(value Error) ErrorOrReference
ErrorValue constructs the Error Object union case.
func (ErrorOrReference) Error ¶
func (value ErrorOrReference) Error() (Error, bool)
Error returns the Error Object case and true.
func (ErrorOrReference) Reference ¶
func (value ErrorOrReference) Reference() (Reference, bool)
Reference returns the Reference Object case and true.
type Example ¶
type Example struct {
// contains filtered or unexported fields
}
Example is an immutable OpenRPC Example Object.
func NewExample ¶
func NewExample(input ExampleInput) (Example, error)
NewExample constructs an Example Object. A JSON null Value remains a present required value.
func (Example) Description ¶
Description returns the optional rich-text description.
func (Example) Extensions ¶
func (fields Example) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Example) UnknownFields ¶
func (fields Example) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type ExampleInput ¶
type ExampleInput struct {
Name string
Summary *string
Description *string
Value jsonvalue.Value
Extensions Fields
UnknownFields Fields
}
ExampleInput supplies Example Object fields.
type ExampleOrReference ¶
type ExampleOrReference struct {
// contains filtered or unexported fields
}
ExampleOrReference is an Example Object or Reference Object union.
func ExampleReference ¶
func ExampleReference(value Reference) ExampleOrReference
ExampleReference constructs the Reference Object union case.
func ExampleValue ¶
func ExampleValue(value Example) ExampleOrReference
ExampleValue constructs the Example Object union case.
func (ExampleOrReference) Example ¶
func (value ExampleOrReference) Example() (Example, bool)
Example returns the Example Object case and true.
func (ExampleOrReference) Reference ¶
func (value ExampleOrReference) Reference() (Reference, bool)
Reference returns the Reference Object case and true.
type ExamplePairing ¶
type ExamplePairing struct {
// contains filtered or unexported fields
}
ExamplePairing is an immutable OpenRPC Example Pairing Object.
func NewExamplePairing ¶
func NewExamplePairing(input ExamplePairingInput) (ExamplePairing, error)
NewExamplePairing constructs an Example Pairing Object. An absent Result represents notification usage.
func (ExamplePairing) Description ¶
func (pairing ExamplePairing) Description() (string, bool)
Description returns the optional pairing description.
func (ExamplePairing) Name ¶
func (pairing ExamplePairing) Name() string
Name returns the required pairing name.
func (ExamplePairing) Params ¶
func (pairing ExamplePairing) Params() []ExampleOrReference
Params returns an owned parameter example slice.
func (ExamplePairing) Result ¶
func (pairing ExamplePairing) Result() (ExampleOrReference, bool)
Result returns the optional result example. Absence denotes a notification.
func (ExamplePairing) UnknownFields ¶
func (pairing ExamplePairing) UnknownFields() Fields
UnknownFields returns fields retained by preserving parse mode.
type ExamplePairingInput ¶
type ExamplePairingInput struct {
Name string
Description *string
Params []ExampleOrReference
Result *ExampleOrReference
UnknownFields Fields
}
ExamplePairingInput supplies Example Pairing Object fields.
type ExamplePairingOrReference ¶
type ExamplePairingOrReference struct {
// contains filtered or unexported fields
}
ExamplePairingOrReference is an Example Pairing or Reference Object union.
func ExamplePairingReference ¶
func ExamplePairingReference(value Reference) ExamplePairingOrReference
ExamplePairingReference constructs the Reference Object union case.
func ExamplePairingValue ¶
func ExamplePairingValue(value ExamplePairing) ExamplePairingOrReference
ExamplePairingValue constructs the Example Pairing union case.
func (ExamplePairingOrReference) ExamplePairing ¶
func (value ExamplePairingOrReference) ExamplePairing() (ExamplePairing, bool)
ExamplePairing returns the pairing case and true.
func (ExamplePairingOrReference) Reference ¶
func (value ExamplePairingOrReference) Reference() (Reference, bool)
Reference returns the Reference Object case and true.
type ExternalDocumentation ¶
type ExternalDocumentation struct {
// contains filtered or unexported fields
}
ExternalDocumentation is an immutable External Documentation Object.
func NewExternalDocumentation ¶
func NewExternalDocumentation(input ExternalDocumentationInput) (ExternalDocumentation, error)
NewExternalDocumentation constructs an External Documentation Object.
func (ExternalDocumentation) Description ¶
func (documentation ExternalDocumentation) Description() (string, bool)
Description returns the optional rich-text description.
func (ExternalDocumentation) Extensions ¶
func (fields ExternalDocumentation) Extensions() Fields
Extensions returns immutable specification extension fields.
func (ExternalDocumentation) URL ¶
func (documentation ExternalDocumentation) URL() string
URL returns the required target URL.
func (ExternalDocumentation) UnknownFields ¶
func (fields ExternalDocumentation) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type ExternalDocumentationInput ¶
type ExternalDocumentationInput struct {
URL string
Description *string
Extensions Fields
UnknownFields Fields
}
ExternalDocumentationInput supplies External Documentation Object fields.
type Fields ¶
type Fields struct {
// contains filtered or unexported fields
}
Fields is an immutable, deterministically ordered collection of arbitrary JSON fields.
func NewExtensions ¶
NewExtensions constructs specification extension fields. Names must begin with the case-sensitive x- prefix required by OpenRPC.
func NewUnknownFields ¶
NewUnknownFields constructs preserved standard-looking fields for explicit preserving parser mode.
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
Info is an immutable OpenRPC Info Object.
func (Info) Description ¶
Description returns the optional rich-text description.
func (Info) Extensions ¶
func (fields Info) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Info) TermsOfService ¶
TermsOfService returns the optional terms URL.
func (Info) UnknownFields ¶
func (fields Info) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type InfoInput ¶
type InfoInput struct {
Title string
Version string
Description *string
TermsOfService *string
Contact *Contact
License *License
Extensions Fields
UnknownFields Fields
}
InfoInput supplies Info Object fields. Title and Version must be non-empty.
type Integer ¶
type Integer struct {
// contains filtered or unexported fields
}
Integer is an immutable arbitrary-precision JSON integer lexeme.
func ParseInteger ¶
ParseInteger validates a canonical JSON integer without narrowing it to a Go machine integer.
type License ¶
type License struct {
// contains filtered or unexported fields
}
License is an immutable OpenRPC License Object.
func NewLicense ¶
func NewLicense(input LicenseInput) (License, error)
NewLicense constructs a License Object.
func (License) Extensions ¶
func (fields License) Extensions() Fields
Extensions returns immutable specification extension fields.
func (License) UnknownFields ¶
func (fields License) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type LicenseInput ¶
LicenseInput supplies optional License Object fields.
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link is an immutable OpenRPC Link Object.
func (Link) Description ¶
Description returns the optional rich-text description.
func (Link) Extensions ¶
func (fields Link) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Link) UnknownFields ¶
func (fields Link) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type LinkInput ¶
type LinkInput struct {
Name *jsonvalue.Value
Summary *string
Description *string
Method *string
Params *jsonvalue.Value
Server *Server
Extensions Fields
UnknownFields Fields
}
LinkInput supplies Link Object fields.
type LinkOrReference ¶
type LinkOrReference struct {
// contains filtered or unexported fields
}
LinkOrReference is a Link Object or Reference Object union.
func LinkReference ¶
func LinkReference(value Reference) LinkOrReference
LinkReference constructs the Reference Object union case.
func LinkValue ¶
func LinkValue(value Link) LinkOrReference
LinkValue constructs the Link Object union case.
func (LinkOrReference) Link ¶
func (value LinkOrReference) Link() (Link, bool)
Link returns the Link Object case and true.
func (LinkOrReference) Reference ¶
func (value LinkOrReference) Reference() (Reference, bool)
Reference returns the Reference Object case and true.
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
Method is an immutable OpenRPC Method Object.
func NewMethod ¶
func NewMethod(input MethodInput) (Method, error)
NewMethod constructs a Method Object and owns every supplied collection.
func (Method) Deprecated ¶
Deprecated returns the declared value and whether it was present.
func (Method) DeprecatedOrDefault ¶
DeprecatedOrDefault returns the effective value, whose default is false.
func (Method) Description ¶
Description returns the optional rich-text description.
func (Method) Errors ¶
func (method Method) Errors() ([]ErrorOrReference, bool)
Errors returns an owned optional error slice.
func (Method) Examples ¶
func (method Method) Examples() ([]ExamplePairingOrReference, bool)
Examples returns an owned optional example-pairing slice.
func (Method) Extensions ¶
func (fields Method) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Method) ExternalDocs ¶
func (method Method) ExternalDocs() (ExternalDocumentation, bool)
ExternalDocs returns optional external documentation.
func (Method) Links ¶
func (method Method) Links() ([]LinkOrReference, bool)
Links returns an owned optional link slice.
func (Method) ParamStructure ¶
func (method Method) ParamStructure() (ParamStructure, bool)
ParamStructure returns the effective value and whether it was explicit.
func (Method) Params ¶
func (method Method) Params() []ContentDescriptorOrReference
Params returns an owned required parameter slice.
func (Method) Result ¶
func (method Method) Result() (ContentDescriptorOrReference, bool)
Result returns the optional result. Absence makes the method notification only according to the specification.
func (Method) Tags ¶
func (method Method) Tags() ([]TagOrReference, bool)
Tags returns an owned optional tag slice.
func (Method) UnknownFields ¶
func (fields Method) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type MethodInput ¶
type MethodInput struct {
Name string
Description *string
Summary *string
Servers []Server
HasServers bool
Tags []TagOrReference
HasTags bool
Params []ContentDescriptorOrReference
ParamStructure *ParamStructure
Result *ContentDescriptorOrReference
Errors []ErrorOrReference
HasErrors bool
Links []LinkOrReference
HasLinks bool
Examples []ExamplePairingOrReference
HasExamples bool
Deprecated *bool
ExternalDocs *ExternalDocumentation
Extensions Fields
UnknownFields Fields
}
MethodInput supplies Method Object fields. Params must be non-nil; an empty slice represents a method without parameters.
type MethodOrReference ¶
type MethodOrReference struct {
// contains filtered or unexported fields
}
MethodOrReference is a Method Object or Reference Object union.
func MethodReference ¶
func MethodReference(value Reference) MethodOrReference
MethodReference constructs the Reference Object union case.
func MethodValue ¶
func MethodValue(value Method) MethodOrReference
MethodValue constructs the Method Object union case.
func (MethodOrReference) Method ¶
func (value MethodOrReference) Method() (Method, bool)
Method returns the Method Object case and true.
func (MethodOrReference) Reference ¶
func (value MethodOrReference) Reference() (Reference, bool)
Reference returns the Reference Object case and true.
type MissingRequiredFieldError ¶
type MissingRequiredFieldError struct {
Field string
}
MissingRequiredFieldError identifies one absent required field without including document values.
func (*MissingRequiredFieldError) Error ¶
func (err *MissingRequiredFieldError) Error() string
Error implements error.
func (*MissingRequiredFieldError) Unwrap ¶
func (err *MissingRequiredFieldError) Unwrap() error
Unwrap supports errors.Is with ErrMissingRequiredField.
type ParamStructure ¶
type ParamStructure string
ParamStructure is the method parameter assignment structure.
const ( // ParamStructureByName assigns parameters by Content Descriptor name. ParamStructureByName ParamStructure = "by-name" // ParamStructureByPosition assigns parameters by array position. ParamStructureByPosition ParamStructure = "by-position" // ParamStructureEither permits either assignment structure and is default. ParamStructureEither ParamStructure = "either" )
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
Reference is an immutable OpenRPC Reference Object.
func NewReference ¶
NewReference constructs a Reference Object.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an immutable OpenRPC Server Object.
func NewServer ¶
func NewServer(input ServerInput) (Server, error)
NewServer constructs a Server Object and owns its variables map.
func (Server) Description ¶
Description returns the optional rich-text server description.
func (Server) Extensions ¶
func (fields Server) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Server) UnknownFields ¶
func (fields Server) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type ServerInput ¶
type ServerInput struct {
URL string
Name *string
Description *string
Summary *string
Variables map[string]ServerVariable
HasVariables bool
Extensions Fields
UnknownFields Fields
}
ServerInput supplies Server Object fields.
type ServerVariable ¶
type ServerVariable struct {
// contains filtered or unexported fields
}
ServerVariable is an immutable OpenRPC Server Variable Object.
func NewServerVariable ¶
func NewServerVariable(input ServerVariableInput) (ServerVariable, error)
NewServerVariable constructs a Server Variable Object.
func (ServerVariable) Default ¶
func (variable ServerVariable) Default() string
Default returns the required substitution default.
func (ServerVariable) Description ¶
func (variable ServerVariable) Description() (string, bool)
Description returns the optional rich-text description.
func (ServerVariable) Enum ¶
func (variable ServerVariable) Enum() ([]string, bool)
Enum returns an owned copy of the optional allowed values.
func (ServerVariable) UnknownFields ¶
func (variable ServerVariable) UnknownFields() Fields
UnknownFields returns fields retained by preserving parse mode.
type ServerVariableInput ¶
type ServerVariableInput struct {
Default *string
Description *string
Enum []string
HasEnum bool
UnknownFields Fields
}
ServerVariableInput supplies Server Variable Object fields. Default uses a pointer because the required value may legally be an empty string.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag is an immutable OpenRPC Tag Object.
func (Tag) Description ¶
Description returns the optional tag description.
func (Tag) Extensions ¶
func (fields Tag) Extensions() Fields
Extensions returns immutable specification extension fields.
func (Tag) ExternalDocs ¶
func (tag Tag) ExternalDocs() (ExternalDocumentation, bool)
ExternalDocs returns the optional external documentation.
func (Tag) UnknownFields ¶
func (fields Tag) UnknownFields() Fields
UnknownFields returns immutable fields retained by preserving parse mode.
type TagInput ¶
type TagInput struct {
Name string
Description *string
ExternalDocs *ExternalDocumentation
Extensions Fields
UnknownFields Fields
}
TagInput supplies Tag Object fields.
type TagOrReference ¶
type TagOrReference struct {
// contains filtered or unexported fields
}
TagOrReference is a Tag Object or Reference Object union.
func TagReference ¶
func TagReference(value Reference) TagOrReference
TagReference constructs the Reference Object union case.
func TagValue ¶
func TagValue(value Tag) TagOrReference
TagValue constructs the Tag Object union case.
func (TagOrReference) Reference ¶
func (value TagOrReference) Reference() (Reference, bool)
Reference returns the Reference Object case and true.
func (TagOrReference) Tag ¶
func (value TagOrReference) Tag() (Tag, bool)
Tag returns the Tag Object case and true.
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version is a validated OpenRPC specification version.
func ParseVersion ¶
ParseVersion validates that value belongs to an explicitly supported OpenRPC feature line. Patch releases share their major.minor feature set as required by the specification's versioning rules.
func (Version) FeatureSet ¶
FeatureSet returns the major.minor OpenRPC feature line.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package builder provides ownership-safe, deterministic OpenRPC construction without making design-first documents depend on reflection or registration.
|
Package builder provides ownership-safe, deterministic OpenRPC construction without making design-first documents depend on reflection or registration. |
|
Package compose provides explicit, deterministic OpenRPC filtering, merging, and overlay operations.
|
Package compose provides explicit, deterministic OpenRPC filtering, merging, and overlay operations. |
|
Package diff performs deterministic semantic compatibility comparisons of OpenRPC documents without resolving external resources implicitly.
|
Package diff performs deterministic semantic compatibility comparisons of OpenRPC documents without resolving external resources implicitly. |
|
Package discovery provides transport-neutral OpenRPC service discovery.
|
Package discovery provides transport-neutral OpenRPC service discovery. |
|
Package expression parses and evaluates the JSON Template Language used by OpenRPC runtime expressions.
|
Package expression parses and evaluates the JSON Template Language used by OpenRPC runtime expressions. |
|
internal
|
|
|
specification/cmd/specmatrix
command
Command specmatrix regenerates the reviewed conformance inventories from the pinned OpenRPC specification inputs.
|
Command specmatrix regenerates the reviewed conformance inventories from the pinned OpenRPC specification inputs. |
|
Package jsonrpc adapts transport-neutral OpenRPC discovery to the handler signature used by github.com/faustbrian/golib/pkg/jsonrpc without coupling the core model, parser, or validator to that server implementation.
|
Package jsonrpc adapts transport-neutral OpenRPC discovery to the handler signature used by github.com/faustbrian/golib/pkg/jsonrpc without coupling the core model, parser, or validator to that server implementation. |
|
Package jsonschema provides lossless JSON Schema Draft 7 values used by OpenRPC.
|
Package jsonschema provides lossless JSON Schema Draft 7 values used by OpenRPC. |
|
Package jsonvalue preserves arbitrary JSON values without numeric coercion, key reordering, or shared mutable byte storage.
|
Package jsonvalue preserves arbitrary JSON values without numeric coercion, key reordering, or shared mutable byte storage. |
|
Package observe provides optional, payload-free operation hooks.
|
Package observe provides optional, payload-free operation hooks. |
|
Package parse provides bounded strict and preserving OpenRPC JSON parsing.
|
Package parse provides bounded strict and preserving OpenRPC JSON parsing. |
|
Package reference provides JSON Pointer, URI reference, and bounded OpenRPC reference-resolution primitives without implicit I/O.
|
Package reference provides JSON Pointer, URI reference, and bounded OpenRPC reference-resolution primitives without implicit I/O. |
|
httpstore
Package httpstore provides an optional, SSRF-resistant HTTP document store for the reference resolver.
|
Package httpstore provides an optional, SSRF-resistant HTTP document store for the reference resolver. |
|
Package validate provides deterministic, resource-bounded OpenRPC document validation with stable machine-readable diagnostics.
|
Package validate provides deterministic, resource-bounded OpenRPC document validation with stable machine-readable diagnostics. |