info

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 12

Documentation

Overview

Package info is used for the gRPC server to provide the information such as protocol, sdk version, language, etc, to the client.

The server information can be used by the client to determine:

  • what is the right protocol to use (UDS or TCP)
  • what is the numaflow sdk version used by the server
  • what is language used by the server

The gRPC server (UDF, UDSink, etc.) is supposed to have a shared file system with the client (numa container).

Write() The gPRC server must use this function to write the correct ServerInfo when it starts.

Read() The client is supposed to call the function to read the server information, before it starts to communicate with the gRPC server.

WaitUntilReady() This function checks if the server info file is ready to read. The client (numa container) is supposed to call the function before it starts to Read() the server info file.

Index

Constants

View Source
const MinimumNumaflowVersion = "1.2.0-rc4"

MinimumNumaflowVersion specifies the minimum Numaflow version required by the current SDK version

Variables

View Source
var END = fmt.Sprintf("%U__END__", '\\') // U+005C__END__

Functions

func GetSDKVersion

func GetSDKVersion() string

func WaitUntilReady

func WaitUntilReady(ctx context.Context, opts ...Option) error

WaitUntilReady waits until the server info is ready

func Write

func Write(svrInfo *ServerInfo, opts ...Option) error

Write writes the server info to a file

Types

type Language

type Language string
const (
	Go     Language = "go"
	Python Language = "python"
	Java   Language = "java"
)

type Option

type Option func(*options)

func WithServerInfoFilePath

func WithServerInfoFilePath(f string) Option

WithServerInfoFilePath sets the server info file path

type Protocol

type Protocol string
const (
	UDS Protocol = "uds"
	TCP Protocol = "tcp"
)

type ServerInfo

type ServerInfo struct {
	Protocol               Protocol          `json:"protocol"`
	Language               Language          `json:"language"`
	MinimumNumaflowVersion string            `json:"minimum_numaflow_version"`
	Version                string            `json:"version"`
	Metadata               map[string]string `json:"metadata"`
}

ServerInfo is the information about the server

func Read

func Read(opts ...Option) (*ServerInfo, error)

Read reads the server info from a file

Jump to

Keyboard shortcuts

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