Documentation ¶
Index ¶
- Constants
- type Option
- func WithAuth(name string, args ...string) Option
- func WithClientOptions(opts ...core.ClientOption) Option
- func WithCredential(payload string) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMeshConfigURL(url string) Option
- func WithObserveDataTags(tags ...frame.Tag) Option
- func WithQuicConfig(qc *quic.Config) Option
- func WithServerOptions(opts ...core.ServerOption) Option
- func WithTLSConfig(tc *tls.Config) Option
- func WithZipperAddr(addr string) Option
- type Options
- type Source
- type StreamFunction
- type Zipper
Constants ¶
const (
// DefaultZipperAddr is the default address of downstream zipper.
DefaultZipperAddr = "localhost:9000"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Options)
Option is a function that applies a YoMo-Client option.
func WithClientOptions ¶ added in v1.5.4
func WithClientOptions(opts ...core.ClientOption) Option
WithClientOptions returns a new options with opts.
func WithCredential ¶ added in v1.5.4
WithCredential sets the client credential method (used by client)
func WithLogger ¶ added in v1.6.0
WithLogger sets the client logger
func WithMeshConfigURL ¶
WithMeshConfigURL sets the initial edge-mesh config URL for the YoMo-Zipper.
func WithObserveDataTags ¶ added in v1.6.0
WithObserveDataTags sets client data tag list.
func WithQuicConfig ¶ added in v1.5.4
func WithQuicConfig(qc *quic.Config) Option
WithQuicConfig sets the QUIC configuration for the client.
func WithServerOptions ¶ added in v1.5.4
func WithServerOptions(opts ...core.ServerOption) Option
WithServerOptions returns a new options with opts.
func WithTLSConfig ¶ added in v1.5.4
WithTLSConfig sets the TLS configuration for the client.
func WithZipperAddr ¶
WithZipperAddr return a new options with ZipperAddr set to addr.
type Options ¶ added in v1.5.4
type Options struct { ZipperAddr string // target Zipper endpoint address MeshConfigURL string // meshConfigURL is the URL of edge-mesh config ServerOptions []core.ServerOption ClientOptions []core.ClientOption QuicConfig *quic.Config TLSConfig *tls.Config }
Options are the options for YoMo
func NewOptions ¶ added in v1.5.4
NewOptions creates a new options for YoMo-Client.
type Source ¶
type Source interface { // Close will close the connection to YoMo-Zipper. Close() error // Connect to YoMo-Zipper. Connect() error // SetDataTag will set the tag of data when invoking Write(). SetDataTag(tag frame.Tag) // Write the data to directed downstream. Write(data []byte) (n int, err error) // WriteWithTag will write data with specified tag, default transactionID is epoch time. WriteWithTag(tag frame.Tag, data []byte) error // SetErrorHandler set the error handler function when server error occurs SetErrorHandler(fn func(err error)) // [Experimental] SetReceiveHandler set the observe handler function SetReceiveHandler(fn func(tag frame.Tag, data []byte)) // Write the data to all downstream Broadcast(data []byte) error }
Source is responsible for sending data to yomo.
type StreamFunction ¶
type StreamFunction interface { // SetObserveDataTags set the data tag list that will be observed // Deprecated: use yomo.WithObserveDataTags instead SetObserveDataTags(tag ...frame.Tag) // SetHandler set the handler function, which accept the raw bytes data and return the tag & response SetHandler(fn core.AsyncHandler) error // SetErrorHandler set the error handler function when server error occurs SetErrorHandler(fn func(err error)) // SetPipeHandler set the pipe handler function SetPipeHandler(fn core.PipeHandler) error // Connect create a connection to the zipper Connect() error // Close will close the connection Close() error // Send a data to zipper. Write(tag frame.Tag, carriage []byte) error }
StreamFunction defines serverless streaming functions.
func NewStreamFunction ¶
func NewStreamFunction(name string, opts ...Option) StreamFunction
NewStreamFunction create a stream function.
type Zipper ¶
type Zipper interface { // ConfigWorkflow will register workflows from config files to zipper. ConfigWorkflow(conf string) error // ConfigMesh will register edge-mesh config URL ConfigMesh(url string) error // ListenAndServe start zipper as server. ListenAndServe() error // AddDownstreamZipper will add downstream zipper. AddDownstreamZipper(downstream Zipper) error // Addr returns the listen address of zipper. Addr() string // Stats return insight data Stats() int // Close will close the zipper. Close() error // InitOptions initialize options InitOptions(opts ...Option) }
Zipper is the orchestrator of yomo. There are two types of zipper: one is Upstream Zipper, which is used to connect to multiple downstream zippers, another one is Downstream Zipper (will call it as Zipper directly), which is used to connected by `Upstream Zipper`, `Source` and `Stream Function`
func NewDownstreamZipper ¶
NewDownstreamZipper create a zipper descriptor for downstream zipper.
func NewZipperWithOptions ¶
NewZipperWithOptions create a zipper instance.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
serverless/deno
Package deno provides a js/ts serverless runtime
|
Package deno provides a js/ts serverless runtime |
serverless/wasm
Package wasm provides WebAssembly serverless function runtimes.
|
Package wasm provides WebAssembly serverless function runtimes. |
cmd
|
|
metadata
Package metadata provides a default implements of `Metadata`.
|
Package metadata provides a default implements of `Metadata`. |
router
Package router providers a default implement of `router` and `Route`.
|
Package router providers a default implement of `router` and `Route`. |
ylog
Package ylog provides a slog.Logger instance for logging.
|
Package ylog provides a slog.Logger instance for logging. |
example
|
|
pkg
|
|