config

package
v0.0.0-...-195f29a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: MPL-2.0 Imports: 2 Imported by: 12

Documentation

Overview

Package config is the utility function that keeps the client-server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEqual

func IsEqual(first *Client, second *Client) bool

IsEqual returns true if the clients match.

func IsTarget

func IsTarget(target zmq.Type) bool

IsTarget checks that given zeromq socket type is the handler type

func TargetToClient

func TargetToClient(target zmq.Type) zmq.Type

TargetToClient gets the ZMQ counter-part of the target. Returns zmq.REQ if target is not supported. Returns zmq.REQ for zmq.ROUTER and zmq.REP

func Url

func Url(client *Client) string

Url creates url of the server for the client to connect

If the port is 0, then the client will be inproc, not as tcp todo move to context

Types

type Client

type Client struct {
	ServiceUrl string   `json:"url" yaml:"url"` // Url link of the service
	Id         string   `json:"id" yaml:"id"`
	Port       uint64   `json:"port" yaml:"port"`
	TargetType zmq.Type `json:"zmq_type,omitempty" yaml:"zmq_type,omitempty"` // The service's socket type
	// contains filtered or unexported fields
}

A Client parameters to connect to the dep

func New

func New(serviceUrl string, id string, port uint64, socketType zmq.Type) *Client

New Client

func (*Client) Url

func (client *Client) Url() string

Url of the client

func (*Client) UrlFunc

func (client *Client) UrlFunc(urlFunc func(*Client) string) *Client

UrlFunc sets the context to generate the url

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL