common

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config = ClientConfig{}
)

Functions

func PtrBool

func PtrBool(b bool) *bool

func PtrInt64

func PtrInt64(i int64) *int64

func PtrString

func PtrString(s string) *string

func ReadStdin

func ReadStdin(stdin io.Reader, input Input, queue QueryQueue)

Types

type Call

type Call interface {
	Complete() <-chan any
}

type ClientConfig

type ClientConfig struct {
	ServiceAddr         string
	Namespace           string
	BatchLinger         time.Duration
	MaxRequestsPerBatch int
	RequestTimeout      time.Duration
}

func (*ClientConfig) NewClient

func (*ClientConfig) NewClient() (oxia.AsyncClient, error)

type CommandLoop

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

func NewCommandLoop

func NewCommandLoop(out io.Writer) (*CommandLoop, error)

func (*CommandLoop) Add

func (loop *CommandLoop) Add(query Query)

func (*CommandLoop) Complete

func (loop *CommandLoop) Complete()

type Input

type Input interface {
	Unmarshal(b []byte) (Query, error)
}

type OutputError

type OutputError struct {
	Err string `json:"error,omitempty"`
}

type OutputVersion

type OutputVersion struct {
	VersionId          int64     `json:"version_id"`
	CreatedTimestamp   time.Time `json:"created_timestamp"`
	ModifiedTimestamp  time.Time `json:"modified_timestamp"`
	ModificationsCount int64     `json:"modifications_count"`
	Ephemeral          bool      `json:"ephemeral"`
	ClientIdentity     string    `json:"client_identity"`
}

type Query

type Query interface {
	Perform(client oxia.AsyncClient) Call
}

type QueryQueue

type QueryQueue interface {
	Add(query Query)
}

Jump to

Keyboard shortcuts

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