gcw

package module
v0.0.0-...-ac24f57 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 4 Imported by: 0

README

gcp client wrapper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResponseHandler

type ApiResponseHandler interface {
	HandleResponse(proto.Message)
}

type ClientInterface

type ClientInterface interface {
	Close() error
}

type ClientWrapper

type ClientWrapper[T ClientInterface] struct {
	Ctx context.Context
	// contains filtered or unexported fields
}

func NewClientWrapper

func NewClientWrapper[T ClientInterface](ctx context.Context, new func() (T, error)) ClientWrapper[T]

func (*ClientWrapper[T]) New

func (c *ClientWrapper[T]) New() (T, error)

type CreateIteratorFunc

type CreateIteratorFunc[T ClientInterface, V proto.Message, R proto.Message] func(T, R, context.Context) IteratorInterface[V]

type IteratorInterface

type IteratorInterface[T proto.Message] interface {
	PageInfo() *iterator.PageInfo
	Next() (T, error)
}

type IteratorRequestWrapper

type IteratorRequestWrapper[T ClientInterface, V proto.Message, R proto.Message] struct {
	Req R
	// contains filtered or unexported fields
}

func NewIteratorRequest

func NewIteratorRequest[T ClientInterface, V proto.Message, R proto.Message](req R, fn CreateIteratorFunc[T, V, R]) *IteratorRequestWrapper[T, V, R]

func (*IteratorRequestWrapper[T, V, R]) MakeRequest

func (irw *IteratorRequestWrapper[T, V, R]) MakeRequest(c ClientWrapper[T], h ApiResponseHandler) error

type RequestFunc

type RequestFunc[T ClientInterface, V proto.Message, R proto.Message] func(T, R, context.Context) (V, error)

type RequestWrapper

type RequestWrapper[T ClientInterface, V proto.Message, R proto.Message] struct {
	Req R
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest[T ClientInterface, V proto.Message, R proto.Message](req R, fn RequestFunc[T, V, R]) *RequestWrapper[T, V, R]

func (*RequestWrapper[T, V, R]) MakeRequest

func (rw *RequestWrapper[T, V, R]) MakeRequest(c ClientWrapper[T], h ApiResponseHandler) error

Jump to

Keyboard shortcuts

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