Documentation ¶
Overview ¶
Example ¶
package main import ( "fmt" "log" "time" "github.com/we-be/tritium/pkg/tritium" ) func main() { // Create a new client client, err := tritium.NewClient(&tritium.ClientOptions{ Address: "localhost:40585", Timeout: 5 * time.Second, }) if err != nil { log.Fatal(err) } defer client.Close() // Set a value err = client.Set("hello", []byte("world"), nil) if err != nil { log.Fatal(err) } // Get the value back value, err := client.Get("hello") if err != nil { log.Fatal(err) } fmt.Printf("Value: %s\n", string(value)) }
Output: Value: world
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Tritium RPC client
func NewClient ¶
func NewClient(opts *ClientOptions) (*Client, error)
NewClient creates a new Tritium client
type ClientOptions ¶
ClientOptions contains options for creating a new client
Click to show internal directories.
Click to hide internal directories.