client

package
v0.0.0-...-8f1fe78 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {

	// Cluster interactions
	Register(ctx context.Context, clusterName, secret, clusterNodes, subsystem string) (*pb.RegisterResponse, error)
	RegisterSubsystem(ctx context.Context, clusterName, secret, subsystemNodes, subsystem string) (*pb.RegisterResponse, error)

	// Update
	UpdateState(ctx context.Context, clusterName, secret, stateFile string) (*pb.UpdateStateResponse, error)

	// Job Client Interactions
	AcceptJobs(ctx context.Context, cluster, secret string, jobids []int32) (*pb.AcceptJobsResponse, error)
	SubmitJob(ctx context.Context, job *js.Jobspec, cfg *config.RainbowConfig) (*pb.SubmitJobResponse, error)
	ReceiveJobs(ctx context.Context, cluster, token string, maxJobs int32) (*pb.ReceiveJobsResponse, error)
}

Client interface defines functions required for a valid client

func NewClient

func NewClient(host string) (Client, error)

NewClient creates a new RainbowClient

type RainbowClient

type RainbowClient struct {
	// contains filtered or unexported fields
}

RainbowClient is our instantiation of Client

func (*RainbowClient) AcceptJobs

func (c *RainbowClient) AcceptJobs(
	ctx context.Context,
	cluster string,
	secret string,
	jobids []int32,
) (*pb.AcceptJobsResponse, error)

RequestJobs requests jobs for a specific cluster

func (*RainbowClient) Close

func (c *RainbowClient) Close() error

Close closes the created resources (e.g. connection).

func (*RainbowClient) Connected

func (c *RainbowClient) Connected() bool

Connected returns true if we are connected and the connection is ready

func (*RainbowClient) GetHost

func (c *RainbowClient) GetHost() string

GetHost returns the private hostn name

func (*RainbowClient) ReceiveJobs

func (c *RainbowClient) ReceiveJobs(
	ctx context.Context,
	cluster string,
	secret string,
	maxJobs int32,
) (*pb.ReceiveJobsResponse, error)

ReceiveJobs (request them) for a specific clusters

func (*RainbowClient) Register

func (c *RainbowClient) Register(
	ctx context.Context,
	cluster string,
	secret string,
	clusterNodes string,
	subsystem string,
) (*pb.RegisterResponse, error)

Register makes a request to register a new cluster

func (*RainbowClient) RegisterSubsystem

func (c *RainbowClient) RegisterSubsystem(
	ctx context.Context,
	cluster string,
	secret string,
	subsystemNodes string,
	subsystem string,
) (*pb.RegisterResponse, error)

Register makes a request to register a new cluster

func (*RainbowClient) SubmitJob

func (c *RainbowClient) SubmitJob(
	ctx context.Context,
	job *js.Jobspec,
	cfg *config.RainbowConfig,
) (*pb.SubmitJobResponse, error)

SubmitJob submits a job to a named cluster. The token specific to the cluster is required

func (*RainbowClient) UpdateState

func (c *RainbowClient) UpdateState(
	ctx context.Context,
	cluster string,
	secret string,
	stateFile string,
) (*pb.UpdateStateResponse, error)

UpdateState of an existing cluster

type RegisterRequest

type RegisterRequest struct {
	Name   string
	Secret string
}

Jump to

Keyboard shortcuts

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