Documentation
¶
Overview ¶
Package argos holds shared configuration (WithTransport, WithCodec, …). Import subpackages for runtime types: client, server, stream, filter, errs, metadata, codec, transport.
Index ¶
- type Config
- type Option
- func WithClientMaxMessageSize(size int64) Option
- func WithClientTransportOption(opts ...transport.ClientOption) Option
- func WithCodec(v any) Option
- func WithCodecInstance[T codec.Codec](c T) Option
- func WithCodecNamed(name string) Option
- func WithFilter(f filter.Filter) Option
- func WithListenAddress(addr string) Option
- func WithMaxHeaderBytes(size int) Option
- func WithMaxMessageSize(size int64) Option
- func WithServerTransportOption(opts ...transport.ServerOption) Option
- func WithTarget(target string) Option
- func WithTransport(v any) Option
- func WithTransportInstance[T transport.Transport](t T) Option
- func WithTransportNamed(name string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Transport transport.Transport
Codec codec.Codec
Filters []filter.Filter
ServerTransportOpts []transport.ServerOption
ClientTarget string
ClientTransportOpts []transport.ClientOption
// contains filtered or unexported fields
}
Config is one transport + codec + filter binding.
func (*Config) CodecForCall ¶
CodecForCall returns the Codec for an active call after Run has validated configuration.
func (*Config) ResolveCodec ¶
ResolveCodec returns the configured Codec, resolving a registered name on first use.
func (*Config) ResolveTransport ¶
ResolveTransport returns the configured Transport, resolving a registered name on first use.
func (*Config) ValidateCompatibility ¶
ValidateCompatibility rejects combinations whose built-in wire protocol is tied to a particular codec. Unknown custom identities remain valid for opaque byte transports; restricted transports require a named codec so an accidental binary/text mismatch cannot silently corrupt a call.
type Option ¶
type Option func(*Config)
Option configures a Service or Client.
func WithClientMaxMessageSize ¶
WithClientMaxMessageSize limits one encoded request or response message on the client side. Non-positive values use the transport default.
func WithClientTransportOption ¶
func WithClientTransportOption(opts ...transport.ClientOption) Option
WithClientTransportOption appends client dial/open options.
func WithCodec ¶
WithCodec sets Codec from an instance or a registered name ("protobuf", ...). For a name, import the codec subpackage so init registers the factory.
Prefer WithCodecInstance or WithCodecNamed for compile-time checks.
func WithCodecInstance ¶
WithCodecInstance sets Codec from a concrete or interface value.
func WithCodecNamed ¶
WithCodecNamed sets Codec from a registered factory name.
func WithFilter ¶
WithFilter appends a Filter. Server and client share the same type.
func WithListenAddress ¶
WithListenAddress sets the server listen address (server only).
func WithMaxHeaderBytes ¶
WithMaxHeaderBytes limits HTTP request headers on transports that support the setting. Non-positive values use the transport default.
func WithMaxMessageSize ¶
WithMaxMessageSize limits one encoded request or response message on the server side. Non-positive values use the transport default.
func WithServerTransportOption ¶
func WithServerTransportOption(opts ...transport.ServerOption) Option
WithServerTransportOption appends server listen options.
func WithTarget ¶
WithTarget sets a client dial target (scheme://service-identifier, e.g. ip://127.0.0.1:9090).
func WithTransport ¶
WithTransport sets Transport from an instance or a registered name ("http2", ...). For a name, import the transport subpackage so init registers the factory.
Go disallows interface types with methods in union constraints, so this accepts any and type-asserts at runtime. Prefer WithTransportInstance or WithTransportNamed for compile-time checks.
func WithTransportInstance ¶
WithTransportInstance sets Transport from a concrete or interface value.
func WithTransportNamed ¶
WithTransportNamed sets Transport from a registered factory name.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client opens calls through one Transport and Codec.
|
Package client opens calls through one Transport and Codec. |
|
cmd
|
|
|
argos
command
Command argos is the argos toolchain entrypoint.
|
Command argos is the argos toolchain entrypoint. |
|
Package codec converts messages to and from bytes.
|
Package codec converts messages to and from bytes. |
|
Package errs defines argos status codes and errors.
|
Package errs defines argos status codes and errors. |
|
example
|
|
|
Package filter wraps calls with cross-cutting handlers.
|
Package filter wraps calls with cross-cutting handlers. |
|
internal
|
|
|
cmd
Package cmd defines the argos CLI command tree.
|
Package cmd defines the argos CLI command tree. |
|
cmd/frontend
Package frontend defines argos frontend inspection subcommands.
|
Package frontend defines argos frontend inspection subcommands. |
|
cmd/generate
Package generate defines argos generate subcommands.
|
Package generate defines argos generate subcommands. |
|
codegen/check
Package check holds helpers for comparing generated Go source.
|
Package check holds helpers for comparing generated Go source. |
|
codegen/frontend
Package frontend converts IDL inputs into codegen IR.
|
Package frontend converts IDL inputs into codegen IR. |
|
codegen/frontend/execplugin
Package execplugin runs external IDL frontends that emit JSON IR on stdout.
|
Package execplugin runs external IDL frontends that emit JSON IR on stdout. |
|
codegen/frontend/irjson
Package irjson loads codegen IR from JSON files (handwritten or plugin output).
|
Package irjson loads codegen IR from JSON files (handwritten or plugin output). |
|
codegen/frontend/proto
Package proto parses .proto files into codegen IR using protocompile.
|
Package proto parses .proto files into codegen IR using protocompile. |
|
codegen/gen
Package gen renders ir.File into Go source (stub re-export).
|
Package gen renders ir.File into Go source (stub re-export). |
|
codegen/gen/message
Package message renders ir.File into *.pb.go or *.msg.go source.
|
Package message renders ir.File into *.pb.go or *.msg.go source. |
|
codegen/gen/stubgen
Package stubgen renders ir.File into *.argos.go source.
|
Package stubgen renders ir.File into *.argos.go source. |
|
codegen/ir
Package ir is the intermediate representation for argos stub generation.
|
Package ir is the intermediate representation for argos stub generation. |
|
codegen/stub
Package stub generates or checks *.argos.go and message files from IR.
|
Package stub generates or checks *.argos.go and message files from IR. |
|
limits
Package limits provides strict readers for untrusted message bodies.
|
Package limits provides strict readers for untrusted message bodies. |
|
statusmap
Package statusmap holds errs.Code ↔ wire status conversions for http1/http2.
|
Package statusmap holds errs.Code ↔ wire status conversions for http1/http2. |
|
Package metadata carries key/value pairs outside the message body on context.
|
Package metadata carries key/value pairs outside the message body on context. |
|
Package selector resolves client targets by URI scheme into dial addresses.
|
Package selector resolves client targets by URI scheme into dial addresses. |
|
ip
Package ip registers the ip selector for direct host:port targets.
|
Package ip registers the ip selector for direct host:port targets. |
|
Package server binds transports and codecs to method dispatchers.
|
Package server binds transports and codecs to method dispatchers. |
|
Package stream is a decoded call stream.
|
Package stream is a decoded call stream. |
|
Package transport is the network layer: message boundaries, routing keys, and metadata on the wire.
|
Package transport is the network layer: message boundaries, routing keys, and metadata on the wire. |
|
http1
Package http1 implements unary Argos calls over HTTP/1.1.
|
Package http1 implements unary Argos calls over HTTP/1.1. |
|
http2
Package http2 implements gRPC-over-HTTP/2 (h2c) for Argos.
|
Package http2 implements gRPC-over-HTTP/2 (h2c) for Argos. |
|
tcp
Package tcp implements the Argos binary envelope over TCP.
|
Package tcp implements the Argos binary envelope over TCP. |
|
telnet
Package telnet implements a newline-framed text debug transport over TCP.
|
Package telnet implements a newline-framed text debug transport over TCP. |
|
udp
Package udp implements unary Argos calls over UDP.
|
Package udp implements unary Argos calls over UDP. |
|
ws
Package ws implements the Argos binary envelope over WebSocket (RFC6455).
|
Package ws implements the Argos binary envelope over WebSocket (RFC6455). |