primitive

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 4 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 struct {
	// contains filtered or unexported fields
}

Client is a base client for all primitives

func NewClient

func NewClient(primitiveType Type, name string, conn *grpc.ClientConn, opts ...Option) *Client

NewClient creates a new primitive client

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

Close closes the primitive session

func (*Client) Create

func (c *Client) Create(ctx context.Context) error

Create creates an instance of the primitive

func (*Client) GetHeaders

func (c *Client) GetHeaders() primitiveapi.RequestHeaders

GetHeaders gets the primitive headers

func (*Client) Name

func (c *Client) Name() string

Name returns the primitive name

func (*Client) SessionID added in v0.5.5

func (c *Client) SessionID() string

SessionID returns the primitive session identifier

func (*Client) Type

func (c *Client) Type() Type

Type returns the primitive type

type EmptyOption added in v0.5.3

type EmptyOption struct{}

EmptyOption is an empty primitive option

type Option added in v0.5.3

type Option interface {
	// contains filtered or unexported methods
}

Option is a primitive option

func WithClusterKey added in v0.5.4

func WithClusterKey(clusterKey string) Option

WithClusterKey sets the primitive cluster key

func WithSessionID added in v0.5.5

func WithSessionID(sessionID string) Option

WithSessionID sets the primitive session identifier

type Primitive

type Primitive interface {
	// Type returns the primitive type
	Type() Type

	// Name returns the primitive name
	Name() string

	// Close closes the primitive
	Close(ctx context.Context) error
}

Primitive is the base interface for primitives

type Type

type Type string

Type is the type of a primitive

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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