operand

package module
v0.0.0-...-5eacf0a Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 12 Imported by: 0

README

Operand Go SDK

The official Go SDK for the Operand API. Read our API documentation here: https://docs.operand.ai. If you have any questions or feedback, please feel free to reach out to us via email or join our Discord.

Installation
go get -u github.com/operandinc/go-sdk
Usage
client := operand.NewClient(os.Getenv("OPERAND_API_KEY"))
if _, err := client.CreateFile(
    context.Background(),
    "go.txt",
    nil,
    bytes.NewReader([]byte("Hello, World!")),
    nil,
); err != nil {
    // handle the error
}

Documentation

Overview

Package operand is the SDK for the Operand API.

Index

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 is the client for the Operand API.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a new client for the Operand API.

func (*Client) CreateFile

func (c *Client) CreateFile(
	ctx context.Context,
	name string,
	parent *string,
	data io.Reader,
	properties *filev1.Properties,
) (*filev1.CreateFileResponse, error)

CreateFile is a utility method for creating files. Since this is a common operation and is a little more involved, we provide a helper method for it.

func (*Client) FileService

func (c *Client) FileService() filev1connect.FileServiceClient

FileService returns a client for the Operand File Service.

func (*Client) OperandService

func (c *Client) OperandService() operandv1connect.OperandServiceClient

OperandService returns a client for the Operand Operand Service.

func (*Client) TenantService

func (c *Client) TenantService() tenantv1connect.TenantServiceClient

TenantService returns a client for the Operand Tenant Service.

func (*Client) WithEndpoint

func (c *Client) WithEndpoint(endpoint string) *Client

WithEndpoint sets the endpoint for the client.

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(httpClient *http.Client) *Client

WithHTTPClient sets the HTTP client for the client.

Directories

Path Synopsis
file
v1
operand
v1
tenant
v1

Jump to

Keyboard shortcuts

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