DataStructures

package
v0.0.0-...-2d867ee Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

README

Data Structures

This is for storing common data structured between Flotilla Programs. This houses all the protobuffer code.

Generate JS proto:

protoc --js_out=import_style=commonjs,binary:js_proto/ FileStructures.proto

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageAndSendReplyJSON

func PackageAndSendReplyJSON(repjson ReplyJSON, NC *nats.Conn, subj string) error

PackageAndSendReplyJSON will package the reply and send it over nats

func PackageAndSendReplyString

func PackageAndSendReplyString(repstring ReplyString, NC *nats.Conn, subj string) error

PackageAndSendReplyString will package a ReplyString and send it over nats

Types

type ReplyJSON

type ReplyJSON struct {
	Success bool   `json:"success"`
	Message []byte `json:"message"`
}

ReplyJSON is the same as ReplyString except the message will be a JSON byte array

type ReplyString

type ReplyString struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

ReplyString will return a reply status with a success boolean and a message attached

func ConstructNegativeReplyString

func ConstructNegativeReplyString(mess string) ReplyString

ConstructNegativeReplyString will create a replyString object with a failed status

func NewReplyStringFromMSG

func NewReplyStringFromMSG(msg *nats.Msg) (ReplyString, error)

NewReplyStringFromMSG will take a nats msg and attempt to turn it into a ReplyString

Directories

Path Synopsis
StatusStructures

Jump to

Keyboard shortcuts

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