Categorygithub.com/unit-io/unitdb-go
modulepackage
0.1.0
Repository: https://github.com/unit-io/unitdb-go.git
Documentation: pkg.go.dev

# README

Unitdb go client GoDoc

The Unitdb messaging system is an open source messaging system for microservice, and real-time internet connected devices. The Unitdb messaging API is built for speed and security.

The Unitdb is a real-time messaging system for microservices, and real-tme internet connected devices, it is based on GRPC communication. The Unitdb messaging system satisfy the requirements for low latency and binary messaging, it is perfect messaging system for internet connected devices.

Quick Start

To build unitdb from source code use go get command and copy unitdb.conf to the path unitdb binary is placed.

go get -u github.com/unit-io/unitdb/server

Usage

Detailed API documentation is available using the godoc.org service.

Make use of the client by importing it in your Go client source code. For example,

import "github.com/unit-io/unitdb-go"

Samples are available in the examples directory for reference. To build unitdb server from latest source code use "replace" in go.mod to point to your local module.

go mod edit -replace github.com/unit-io/unitdb=$GOPATH/src/github.com/unit-io/unitdb

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are welcome.

Licensing

This project is licensed under MIT License.

# Packages

No description provided by the author

# Functions

AddServer returns an Option which makes client connection and set server url.
Connect takes a connected net.Conn and performs the initial handshake.
No description provided by the author
No description provided by the author
TimeNow returns current wall time in UTC rounded to milliseconds.
WithBatchByteThreshold sets byte threshold for publish batch.
WithBatchCountThreshold sets message count threshold for publish batch.
WithBatchDuration sets batch duration to group publish requestes into single group.
WithCleanSession returns an Option which makes client connection and set CleanSession.
WithClientID returns an Option which makes client connection and set ClientID.
WithConnectionHandler sets handler function to be called when client is connected.
WithConnectionLostHandler sets handler function to be called when connection to the client is lost.
WithConnectTimeout limits how long the client will wait when trying to open a connection to server before timing out and erroring the attempt.
WithDefaultOptions will create client connection with some default values.
WithInsecure returns an Option which makes client connection with insecure flag so that client can provide topic with key prefix.
WithKeepAlive will set the amount of time (in seconds) that the client should wait before sending a PING request to the server.
WithLast allows to specify duration to retrive stored messages on a new relay request.
WithPingTimeout will set the amount of time (in seconds) that the client will wait after sending a PING request to the server, before deciding that the connection has been lost.
WithPubDelay allows to specify delay in milliseconds for delivery of messages if DeliveryMode is set to RELIABLE or BATCH.
WithPubDeliveryMode sets DeliveryMode of publish packet.
WithResumeSubs will enable resuming stored subscribe/unsubscribe messages when connecting but not reconnecting if CleanSession is false.
WithSessionKey returns an Option which makes client connection with an existing SessionKey.
WithStoreLogReleaseDuration sets log release duration, it must be greater than WriteTimeout.
WithStoreDir sets database directory.
WithStoreSize sets buffer size store will use to write messages into log.
WithSubDelay allows to specify delay in milliseconds for delivery of messages if DeliveryMode is set to RELIABLE or BATCH.
WithSubDeliveryMode sets DeliveryMode of a subscription.
WithTLSConfig will set an SSL/TLS configuration to be used when connecting to server.
WithTTL allows to specify time to live for a publish packet.
WithUserName returns an Option which makes client connection and pass UserName.
WithWriteTimeout puts a limit on how long a publish should block until it unblocks with a timeout error.

# Constants

Various constant on Topic.
Various constant on Topic.
Maximum depth for topic using a separator.
Various constant on Topic.
Various constant on Topic.
The separator character.
Various constant on Topic.
Various constant on Topic.
Various constant on Topic.

# Structs

ConnectResult is an extension of result containing extra fields it provides information about calls to Connect().
DisconnectResult is an extension of result containing the extra fields required to provide information about calls to Disconnect().
MessageAndResult is a type that contains both a Message and a Result.
No description provided by the author
PublishResult is an extension of result containing the extra fields required to provide information about calls to Publish().
No description provided by the author
PutResult is an extension of result containing the extra fields required to provide information about calls to Put().
RelayResult is an extension of result containing the extra fields required to provide information about calls to Relay().
SubscribeResult is an extension of result containing the extra fields required to provide information about calls to Subscribe().
topic represents a parsed topic.
UnsubscribeResult is an extension of result containing the extra fields required to provide information about calls to Unsubscribe().

# Interfaces

No description provided by the author
Message defines the externals that a message implementation must support these are received messages that are passed, not internal messages.
Options it contains configurable options for client.
PubOptions it contains configurable options for Publish.
Re;Options it contains configurable options for Subscribe.
No description provided by the author
SubOptions it contains configurable options for Subscribe.

# Type aliases

ConnectionHandler is a callback that is called when connection to the server is established.
ConnectionLostHandler is a callback that is set to be executed upon an uninteded disconnection from server.
MID is 32-bit local message identifier.