natsclient

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

natsclient

client for NATS-enabled D-ISP

Documentation

Index

Constants

View Source
const DefaultServer = "disp-requests"

Variables

This section is empty.

Functions

func ConnectAPI

func ConnectAPI(url, srvtopic string) *nats.Conn

func EntityRegister

func EntityRegister(server, identity, token, roles, groups string) (passCd string, status int)

func EntityRetrieve

func EntityRetrieve(server, identity, token string) (resp string, status int)

func LoginAPI

func LoginAPI(server, user, passCode string) string

func RelationRegister

func RelationRegister(server, identity, token string) (resp string, status int)

func SetAspect

func SetAspect(dopts Dopts, val string)

func SetCount

func SetCount(dopts Dopts, val bool)

func SetDomain

func SetDomain(dopts Dopts, val string)

func SetEncryptDataPKey

func SetEncryptDataPKey(dopts Dopts, val string)

func SetEntity

func SetEntity(dopts Dopts, val string)

func SetEntityAccess added in v0.0.2

func SetEntityAccess(dopts Dopts, val string)

func SetGroups

func SetGroups(dopts Dopts, val string)

func SetMatch

func SetMatch(dopts Dopts, val string)

func SetNoHeaders

func SetNoHeaders(dopts Dopts, val bool)

func SetRDID

func SetRDID(dopts Dopts, val string)

func SetRoles

func SetRoles(dopts Dopts, val string)

func SetTag

func SetTag(dopts Dopts, val string)

func SetTimestamp

func SetTimestamp(dopts Dopts, val string)

func SetVal

func SetVal(dopts Dopts, val string)

func SetWithHeaders

func SetWithHeaders(dopts Dopts, val bool)

func SysAdminRegister

func SysAdminRegister(server, identity, passCode, token, roles, groups string) (passCd string, status int)

Types

type Dopts

type Dopts map[string]interface{}

type NATSReqHeader

type NATSReqHeader struct {
	Mode          string                 `json:"mode"`
	Path          string                 `json:"path"`
	Flags         map[string]interface{} `json:"flags"`
	Authorization string                 `json:"authorization"`
	Accept        string                 `json:"accept"`
}

type NATSRequest

type NATSRequest struct {
	Header NATSReqHeader `json:"header"`
	Body   []byte        `json:"body"`
}

type NATSResponse

type NATSResponse struct {
	Header   NATSResponseHeader `json:"header"`
	Response string             `json:"response"`
}

func Get

func Get(server string, dopts Dopts, token string) *NATSResponse

func Post

func Post(server string, body []byte, dopts Dopts, token string) *NATSResponse

type NATSResponseHeader

type NATSResponseHeader struct {
	Created      bool   `json:"created,omitempty"`
	Timestamp    int64  `json:"timestamp,omitempty"`
	Path         string `json:"path,omitempty"`
	Doc          string `json:"docId,omitempty"`
	DocVersion   string `json:"docVersion,omitempty"`
	Status       int    `json:"status"`
	ErrorStr     string `json:"error_str,omitempty"`
	ServerID     string `json:"serverID,omitempty"`
	Chunks       int    `json:"chunks,omitempty"`
	EncryptedHdr []byte `json:"encrypted_hdr,omitempty"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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