spice

package
v0.0.0-...-9da37ed Latest Latest
Warning

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

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

Documentation

Overview

Code generated by github.com/ecordell/optgen. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateHead

func MigrateHead(ctx context.Context, out io.Writer, datastore, uri string) error

MigrateHead migrates a Datastore to the latest revision defined in spicedb

Types

type Cluster

type Cluster []*Node

Cluster is a set of spicedb nodes

func NewClusterFromCockroachCluster

func NewClusterFromCockroachCluster(c cockroach.Cluster, opts ...NodeOption) Cluster

NewClusterFromCockroachCluster creates a spicedb instance for every cockroach instance, with each spicedb configured to talk to the corresponding cockraoch node.

func (*Cluster) Connect

func (c *Cluster) Connect(ctx context.Context, out io.Writer) error

Connect blocks until a connection can be made to each instance in the cluster

func (*Cluster) Start

func (c *Cluster) Start(ctx context.Context, out io.Writer, prefix string, args ...string) error

Start starts the entire cluster of spicedb instances

func (*Cluster) Stop

func (c *Cluster) Stop(out io.Writer) error

Stop stops the entire cluster of spicedb instances

type Node

type Node struct {
	ID             string
	PresharedKey   string
	Datastore      string
	DBName         string
	URI            string
	GrpcPort       int
	HTTPPort       int
	DispatchPort   int
	MetricsPort    int
	HedgingEnabled bool
	Pid            int
	Cancel         context.CancelFunc
	// contains filtered or unexported fields
}

Node represents a single instance of spicedb started via exec

func NewNodeWithOptions

func NewNodeWithOptions(opts ...NodeOption) *Node

NewNodeWithOptions creates a new Node with the passed in options set

func NodeWithOptions

func NodeWithOptions(n *Node, opts ...NodeOption) *Node

NodeWithOptions configures an existing Node with the passed in options set

func (*Node) Client

func (s *Node) Client() e2e.Client

Client returns a client that can talk to a started spicedb instance

func (*Node) Connect

func (s *Node) Connect(ctx context.Context, out io.Writer) error

Connect blocks until a connection to the spicedb instance can be established. Once connected, the client is avaialable via Client()

func (*Node) Start

func (s *Node) Start(ctx context.Context, logprefix string, args ...string) error

Start starts an instance of spicedb using the configuration

func (*Node) Stop

func (s *Node) Stop() error

Stop will Cancel a running spicedb process

func (*Node) ToOption

func (n *Node) ToOption() NodeOption

ToOption returns a new NodeOption that sets the values from the passed in Node

type NodeOption

type NodeOption func(n *Node)

func WithCancel

func WithCancel(cancel context.CancelFunc) NodeOption

WithCancel returns an option that can set Cancel on a Node

func WithDBName

func WithDBName(dBName string) NodeOption

WithDBName returns an option that can set DBName on a Node

func WithDatastore

func WithDatastore(datastore string) NodeOption

WithDatastore returns an option that can set Datastore on a Node

func WithDispatchPort

func WithDispatchPort(dispatchPort int) NodeOption

WithDispatchPort returns an option that can set DispatchPort on a Node

func WithGrpcPort

func WithGrpcPort(grpcPort int) NodeOption

WithGrpcPort returns an option that can set GrpcPort on a Node

func WithHTTPPort

func WithHTTPPort(hTTPPort int) NodeOption

WithHTTPPort returns an option that can set HTTPPort on a Node

func WithHedgingEnabled

func WithHedgingEnabled(hedgingEnabled bool) NodeOption

WithHedgingEnabled returns an option that can set HedgingEnabled on a Node

func WithID

func WithID(iD string) NodeOption

WithID returns an option that can set ID on a Node

func WithMetricsPort

func WithMetricsPort(metricsPort int) NodeOption

WithMetricsPort returns an option that can set MetricsPort on a Node

func WithPid

func WithPid(pid int) NodeOption

WithPid returns an option that can set Pid on a Node

func WithPresharedKey

func WithPresharedKey(presharedKey string) NodeOption

WithPresharedKey returns an option that can set PresharedKey on a Node

func WithTestDefaults

func WithTestDefaults(opts ...NodeOption) NodeOption

WithTestDefaults sets the default values for Node

func WithURI

func WithURI(uRI string) NodeOption

WithURI returns an option that can set URI on a Node

Jump to

Keyboard shortcuts

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