-
Notifications
You must be signed in to change notification settings - Fork 1
/
docs.json
1 lines (1 loc) · 15.4 KB
/
docs.json
1
[{"name":"Nats","comment":" A nats.io client for Elm\n\n\n# socket\n\n@docs connect\n\n\n# pub/sub/request\n\n@docs publish, publishRequest\n\n@docs subscribe, groupSubscribe\n\n@docs request, requestWithTimeout, customRequest, track, cancelRequest, withMarker\n\n\n# Types\n\n@docs Config, State, Msg, withInboxPrefix\n\n\n# Effects\n\n@docs Effect, Sub, applyEffectAndSub\n\n\n# ...\n\n@docs init, update, subscriptions, activeRequests\n\n","unions":[{"name":"State","comment":" The nats internal state\n","args":["datatype","msg"],"cases":[]}],"aliases":[{"name":"Config","comment":" The NATS configuration\n","args":["datatype","portdatatype","msg"],"type":"Nats.Internal.Types.Config datatype portdatatype msg"},{"name":"Effect","comment":" A nats effect\n\nKind of like Cmd, but will be converted at the last moment to regular Cmd\n\n","args":["datatype","msg"],"type":"Nats.Internal.Types.Effect datatype msg"},{"name":"Msg","comment":" A nats internal Msg\n","args":["datatype","msg"],"type":"Nats.Internal.Types.Msg datatype msg"},{"name":"Sub","comment":" A nats subscription\n\nWill be converted at the last moment to regular Sub.\n\n","args":["datatype","msg"],"type":"Nats.Internal.Sub.Sub datatype msg"}],"values":[{"name":"activeRequests","comment":" List all the active requests\n","type":"Nats.State datatype msg -> List.List { sid : String.String, id : String.String, marker : Maybe.Maybe String.String, subject : String.String, inbox : String.String }"},{"name":"applyEffectAndSub","comment":" Update the nats state according to all the Nats.Effect and Nats.Sub gathered\nby the app root component, and emit all the necessary Cmd\n","type":"Nats.Config datatype portdatatype msg -> Nats.Effect datatype msg -> Nats.Sub datatype msg -> Nats.State datatype msg -> ( Nats.State datatype msg, Platform.Cmd.Cmd msg )"},{"name":"cancelRequest","comment":" Cancel an active request, given its marker\n","type":"String.String -> Nats.Effect datatype msg"},{"name":"connect","comment":" Open a socket\n\nThe socket will be opened as soon as the subscription is active, and until\nthe subscriptions is removed.\n\nThe socket may get closed if a network error occurs, in which case a\n'SocketError' event will be sent\n\nAfter the subscription is removed, the handler will receive a SocketClosed\nevent.\n\n","type":"Nats.Protocol.ConnectOptions -> Nats.Socket.Socket -> (Nats.Events.SocketEvent -> msg) -> Nats.Sub datatype msg"},{"name":"customRequest","comment":" Create a request with custom features\n","type":"{ marker : String.String, subject : String.String, replyTo : Maybe.Maybe String.String, message : datatype, onTimeout : Nats.Errors.Timeout -> msg, onResponse : Nats.Protocol.Message datatype -> ( Maybe.Maybe msg, Basics.Bool ), timeout : Maybe.Maybe Basics.Int } -> Nats.Effect datatype msg"},{"name":"groupSubscribe","comment":" Subscribe to a subject with a group\n\nIf you wish to subscribe on a non-default socket, use Nats.Sub.onSocket\n\n","type":"String.String -> String.String -> (Nats.Protocol.Message datatype -> msg) -> Nats.Sub datatype msg"},{"name":"init","comment":" Initialise a new nats state\n","type":"Random.Seed -> Time.Posix -> Nats.State datatype msg"},{"name":"publish","comment":" Publish a new message on a given subject\n\nIf you wish to send it on a non-default socket, use Nats.Effect.onSocket\n\n","type":"String.String -> datatype -> Nats.Effect datatype msg"},{"name":"publishRequest","comment":" Publish a new message on a given subject, with a 'replyTo' attribute\n","type":"String.String -> String.String -> datatype -> Nats.Effect datatype msg"},{"name":"request","comment":" Create a request\n\nThe timeout is 5s by default\n\n","type":"String.String -> datatype -> (Result.Result Nats.Errors.Timeout datatype -> msg) -> Nats.Effect datatype msg"},{"name":"requestWithTimeout","comment":" Create a request with a custom timeout\n","type":"Basics.Int -> String.String -> datatype -> (Result.Result Nats.Errors.Timeout datatype -> msg) -> Nats.Effect datatype msg"},{"name":"subscribe","comment":" Subscribe to a subject\n\nIf you wish to subscribe on a non-default socket, use Nats.Sub.onSocket\n\n","type":"String.String -> (Nats.Protocol.Message datatype -> msg) -> Nats.Sub datatype msg"},{"name":"subscriptions","comment":" Connect the nats internal state to the ports\n","type":"Nats.Config datatype portdatatype msg -> Nats.State datatype msg -> Platform.Sub.Sub msg"},{"name":"track","comment":" Track a request\n","type":"String.String -> Nats.Sub datatype msg"},{"name":"update","comment":" Handle Nats Msg\n","type":"Nats.Config datatype portdatatype msg -> Nats.Msg datatype msg -> Nats.State datatype msg -> ( Nats.State datatype msg, Platform.Cmd.Cmd msg )"},{"name":"withInboxPrefix","comment":" Set a custom inbox prefix\n","type":"String.String -> Nats.State datatype msg -> Nats.State datatype msg"},{"name":"withMarker","comment":" Add a marker on a request\n\nIf the effect is not a request, the function is no-op\n\n","type":"String.String -> Nats.Effect datatype msg -> Nats.Effect datatype msg"}],"binops":[]},{"name":"Nats.Config","comment":" Define the configuration for NATS\n\n@docs bytes, bytesPorts, string, withDebug\n\n","unions":[],"aliases":[],"values":[{"name":"bytes","comment":" Create a NATS configuration for bytes messages\n\nThe binary contents will be base64 encoded/decoded for passing through the ports\n\n","type":"(Nats.Msg Bytes.Bytes msg -> msg) -> Nats.PortsAPI.Ports String.String (Nats.Msg Bytes.Bytes msg) -> Nats.Config Bytes.Bytes String.String msg"},{"name":"bytesPorts","comment":" Create a NATS configuration for bytes messages through ports supporting\nthe Bytes type.\n\nThe binary contents will be passed as is through the ports.\nCurrently the only known compiler supporting this is the Lamdera compiler, which\nrequires the dependency \"lamdera/codecs\" to be added to your project.\n\n","type":"(Nats.Msg Bytes.Bytes msg -> msg) -> Nats.PortsAPI.Ports Bytes.Bytes (Nats.Msg Bytes.Bytes msg) -> Nats.Config Bytes.Bytes Bytes.Bytes msg"},{"name":"string","comment":" Create a NATS configuration for string messages\n\nThe parentMsg typically transform a Nats.Msg into the host application top-level\nmessage.\n\n type Msg =\n NatsMsg (Nats.Msg Msg)\n | ...\n\n natsConfig =\n Nats.Config.init NatsMsg {}\n\n","type":"(Nats.Msg String.String msg -> msg) -> Nats.PortsAPI.Ports String.String (Nats.Msg String.String msg) -> Nats.Config String.String String.String msg"},{"name":"withDebug","comment":" Enable debug\n","type":"Basics.Bool -> Nats.Config datatype portdatatype msg -> Nats.Config datatype portdatatype msg"}],"binops":[]},{"name":"Nats.Effect","comment":" The Nats Effect API\n\nIf you are familiar with the core Cmd api, you will feel at home here\n\n@docs none, map, batch, onSocket, setRequestMarker\n\n","unions":[],"aliases":[],"values":[{"name":"batch","comment":" Batch several nats effect, pretty much like Cmd.batch\n","type":"List.List (Nats.Effect datatype msg) -> Nats.Effect datatype msg"},{"name":"map","comment":" Transform the messages produced by an effect\n","type":"(a -> b) -> Nats.Effect datatype a -> Nats.Effect datatype b"},{"name":"none","comment":" Tell nats there are no effect\n","type":"Nats.Effect datatype msg"},{"name":"onSocket","comment":" Set / change the socket on which the effect should apply\n","type":"String.String -> Nats.Effect datatype msg -> Nats.Effect datatype msg"},{"name":"setRequestMarker","comment":" if the effect is a single request, set its marker to the given one\n","type":"String.String -> Nats.Effect datatype msg -> Nats.Effect datatype msg"}],"binops":[]},{"name":"Nats.Errors","comment":" Nats errors\n\n@docs Timeout\n\n","unions":[],"aliases":[{"name":"Timeout","comment":" A timeout error. The value is the time at which the timeout\nwas triggered\n","args":[],"type":"Time.Posix"}],"values":[],"binops":[]},{"name":"Nats.Events","comment":" Event types\n\n@docs SocketEvent\n\n","unions":[{"name":"SocketEvent","comment":" Event send during a socket lifecycle\n","args":[],"cases":[["SocketOpen",["Nats.Protocol.ServerInfo"]],["SocketClose",[]],["SocketError",["String.String"]],["RequestCancel",["{ sid : String.String, id : String.String, marker : Maybe.Maybe String.String, subject : String.String, inbox : String.String }"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Nats.PortsAPI","comment":" Defines the API for the ports that are required to interface with JS.\n\n@docs Ports\n\n@docs Command, Event, Send, Receive\n\n","unions":[],"aliases":[{"name":"Command","comment":" A command for the js side\n","args":["datatype"],"type":"Nats.Internal.Ports.Command datatype"},{"name":"Event","comment":" An event from the js side\n","args":["datatype"],"type":"Nats.Internal.Ports.Event datatype"},{"name":"Ports","comment":" This is the API that the ports module must implement.\n","args":["datatype","msg"],"type":"{ send : Nats.PortsAPI.Send datatype msg, receive : Nats.PortsAPI.Receive datatype msg }"},{"name":"Receive","comment":" the port signature for receiving events from the js side\n","args":["datatype","msg"],"type":"(Nats.PortsAPI.Event datatype -> msg) -> Platform.Sub.Sub msg"},{"name":"Send","comment":" the port signature for sending commands to the js side\n","args":["datatype","msg"],"type":"Nats.PortsAPI.Command datatype -> Platform.Cmd.Cmd msg"}],"values":[],"binops":[]},{"name":"Nats.Protocol","comment":" Provides types and utilities for the NATS protocol\n\n@docs Operation, Message, ServerInfo, ConnectOptions\n@docs parseString, parseBytes, toBytes, toString\n\n@docs ParseResult, ParseState, initialParseState\n\n","unions":[{"name":"Operation","comment":" Typed operations of the NATS protocol\n\nHere is the protocol documentation:\n\n CONNECT Client Sent to server to specify connection information\n PUB Client Publish a message to a subject, with optional reply subject\n SUB Client Subscribe to a subject (or subject wildcard)\n UNSUB Client Unsubscribe (or auto-unsubscribe) from subject\n MSG Server Delivers a message payload to a subscriber\n PING Both PING keep-alive message\n PONG Both PONG keep-alive response\n +OK Server Acknowledges well-formed protocol message in verbose mode\n -ERR Server Indicates a protocol error. Will cause client disconnect.\n\n","args":["datatype"],"cases":[["INFO",["Nats.Protocol.ServerInfo"]],["CONNECT",["Nats.Protocol.ConnectOptions"]],["PUB",["Nats.Protocol.Message datatype"]],["SUB",["String.String","String.String","String.String"]],["UNSUB",["String.String","Basics.Int"]],["MSG",["String.String","Nats.Protocol.Message datatype"]],["PING",[]],["PONG",[]],["OK",[]],["ERR",["String.String"]]]},{"name":"ParseState","comment":" A temporary state when a parsing an operation is incomplete\n","args":["datatype"],"cases":[]}],"aliases":[{"name":"ConnectOptions","comment":" Options for the CONNECT operation\n","args":[],"type":"{ verbose : Basics.Bool, pedantic : Basics.Bool, auth_token : Maybe.Maybe String.String, user : Maybe.Maybe String.String, pass : Maybe.Maybe String.String, name : Maybe.Maybe String.String, lang : String.String, version : String.String, protocol : Basics.Int }"},{"name":"Message","comment":" A NATS message\n","args":["datatype"],"type":"{ subject : String.String, replyTo : String.String, size : Basics.Int, data : datatype }"},{"name":"ParseResult","comment":" The result of parsing an operation\n","args":["datatype"],"type":"Result.Result String.String ( List.List (Nats.Protocol.Operation datatype), Nats.Protocol.ParseState datatype )"},{"name":"ServerInfo","comment":" Information sent by the server immediately after opening the connection\n","args":[],"type":"{ server_id : String.String, version : String.String, go : String.String, host : String.String, port_ : Basics.Int, auth_required : Basics.Bool, max_payload : Basics.Int }"}],"values":[{"name":"initialParseState","comment":" Returns a initial ParseState\n","type":"Nats.Protocol.ParseState datatype"},{"name":"parseBytes","comment":" Parse an operation from binary data.\n\nAny message contained will be of type 'Bytes'\n\n","type":"Nats.Protocol.ParseState Bytes.Bytes -> Bytes.Bytes -> Nats.Protocol.ParseResult Bytes.Bytes"},{"name":"parseString","comment":" Parse an operation (generally received from the server) from a string\n\nAny message contained will be of type 'String'\n\n","type":"Nats.Protocol.ParseState String.String -> String.String -> Nats.Protocol.ParseResult String.String"},{"name":"toBytes","comment":" serialize to Bytes\n","type":"Nats.Protocol.Operation Bytes.Bytes -> Bytes.Bytes"},{"name":"toString","comment":" serialize an Operation (generally for sending to the server)\n\nif the operation contains data as bytes, the result string will be base64 encoded\n\n","type":"Nats.Protocol.Operation String.String -> String.String"}],"binops":[]},{"name":"Nats.Socket","comment":" A socket defines a connection to a nats server\n\n@docs Status, Socket\n\n@docs new, setDefault, withDebug\n\n\n# Authentication\n\n@docs connectOptions\n@docs withAuthToken, withUserPass\n\n","unions":[{"name":"Status","comment":" Possible statuses of a socket\n","args":[],"cases":[["Undefined",[]],["Opening",[]],["Opened",[]],["Connecting",[]],["Connected",[]],["Closing",[]],["Closed",[]],["Error",["String.String"]]]}],"aliases":[{"name":"Socket","comment":" Representation of a Nats connection properties\n","args":[],"type":"Nats.Internal.Types.Socket"}],"values":[{"name":"connectOptions","comment":" Build the smallest ConnectOptions possible\n\nYou generally want to combine it with 'withUserPass' or 'withAuthToken'\n\n","type":"String.String -> String.String -> Nats.Protocol.ConnectOptions"},{"name":"new","comment":" Initialize a Socket with a unique ID and a endpoint url\n\nThe 'sid' can be used in various places of the API to choose which socket\nshould handle an effect or a subscription.\n\n","type":"String.String -> String.String -> Nats.Socket.Socket"},{"name":"setDefault","comment":" Set this socket as the default one\n\nIf an app has several opened sockets, one must be the default one. By default,\nthe default socket is the first to be opened. This function can be used to\ndesignate an arbitrary socket as the default one.\n\nIf several sockets have this flag, one of them will be picked\n\n","type":"Nats.Socket.Socket -> Nats.Socket.Socket"},{"name":"withAuthToken","comment":" Authenticate with a auth token\n","type":"String.String -> Nats.Protocol.ConnectOptions -> Nats.Protocol.ConnectOptions"},{"name":"withDebug","comment":" Enable/disable debug mode on the socket\n\nIf the Config debug is on, all sockets will have debug enabled no matter what\nvalue is given to this function.\n\n","type":"Basics.Bool -> Nats.Socket.Socket -> Nats.Socket.Socket"},{"name":"withUserPass","comment":" Authenticate with a username and a password\n","type":"String.String -> String.String -> Nats.Protocol.ConnectOptions -> Nats.Protocol.ConnectOptions"}],"binops":[]},{"name":"Nats.Sub","comment":" Nats Subscription types\n\nThis module mimics Platform.Sub, but for Nats subscriptions\n\n@docs map, batch, none\n\n@docs socket\n\n","unions":[],"aliases":[],"values":[{"name":"batch","comment":" Batch several subscriptions\n","type":"List.List (Nats.Sub datatype msg) -> Nats.Sub datatype msg"},{"name":"map","comment":" Map a Sub a to a Sub msg\n","type":"(a -> msg) -> Nats.Sub datatype a -> Nats.Sub datatype msg"},{"name":"none","comment":" An null subscription\n","type":"Nats.Sub datatype msg"},{"name":"socket","comment":" Set a different socket id on the subscription\n","type":"String.String -> Nats.Sub datatype msg -> Nats.Sub datatype msg"}],"binops":[]}]