ytrpc

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdminClient

func NewAdminClient(c *yt.Config) (yt.AdminClient, error)

NewAdminClient creates new admin client from config.

func NewClient

func NewClient(c *yt.Config) (yt.Client, error)

NewClient creates new client from config.

Note! Table and File clients have stub implementations. If you need one of those use http client instead.

func NewCypressClient

func NewCypressClient(c *yt.Config) (yt.CypressClient, error)

NewCypressClient creates new cypress client from config.

Example
package main

import (
	"context"
	"fmt"
	"time"

	"go.ytsaurus.tech/yt/go/ypath"
	"go.ytsaurus.tech/yt/go/yt"
	"go.ytsaurus.tech/yt/go/yt/ytrpc"
	"go.ytsaurus.tech/yt/go/ytlog"
)

func main() {
	yc, err := ytrpc.NewCypressClient(&yt.Config{
		Proxy:             "hume",
		ReadTokenFromFile: true,
		Logger:            ytlog.Must(),
	})
	if err != nil {
		panic(err)
	}

	ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
	defer cancel()

	ok, err := yc.NodeExists(ctx, ypath.Path("//home"), nil)
	if err != nil {
		panic(err)
	}

	fmt.Printf("Node exists? %v\n", ok)
}
Output:

func NewLowLevelSchedulerClient

func NewLowLevelSchedulerClient(c *yt.Config) (yt.LowLevelSchedulerClient, error)

NewLowLevelSchedulerClient creates new stateless scheduler client from config.

Clients should rarely use it directly.

Note! RPC streaming call GetJobStderr is not implemented yet.

func NewLowLevelTxClient

func NewLowLevelTxClient(c *yt.Config) (yt.LowLevelTxClient, error)

NewLowLevelTxClient creates new stateless transaction client from config.

Clients should rarely use it directly.

func NewTestClient

func NewTestClient(t testing.TB, c *yt.Config) (yt.Client, error)

NewTestClient creates new client from config to be used in integration tests.

Note! Table and File clients have stub implementations. If you need one of those use http client instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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