Skip to content

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Juno Go

This is a library that provides you with helper methods for interfacing with the microservices framework, juno.

How to use:

There is a lot of flexibility provided by the library, in terms of connection options and encoding protocol options. However, in order to use the library, none of that is required.

In case you are planning to implement a custom connection option, you will find an example in connection/unix_socket_connection.go.

For all other basic needs, you can get away without worrying about any of that.

A piece of code is worth a thousand words

package main
import (
"fmt"
juno "github.com/bytesonus/juno-go"
)
funcmain() {
module:=juno.Default("./path/to/juno.sock")
channel, err:=module.Initialize("module-name", "1.0.0", nil)
iferr!=nil {
panic(err)
}
_=<-channel// Wait for initialize to completefmt.Println("Initialized!")
channel, err=module.DeclareFunction("printHello", func (argsmap[string]interface{}) interface{} {
fmt.Println("Hello")
returnnil
})
iferr!=nil {
panic(err)
}
_=<-channel// Wait for declaration to completefmt.Println("Declaration!")
channel, err=module.CallFunction("module2.printHelloWorld", nil)
iferr!=nil {
panic(err)
}
response:=<-channel// Wait for declaration to completefmt.Println(response)
}

About

Go library for Juno (https://github.com/bytesonus/juno)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages