clconnect

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package clconnect provides generic fx dependency for standard ConnectRPC services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[RO, RW any](
	cfg Config,
	logs *zap.Logger,
	ro RO, roc ConstructHandler[RO],
	rw RW, rwc ConstructHandler[RW],
) http.Handler

New inits an http handler for the full RPC api.

func Provide

func Provide[RO, RW any](name string) fx.Option

Provide the package components for the DI container.

func TestProvide

func TestProvide[RO, RW, ROC, ROW any](name string) fx.Option

TestProvide provides dependencies for testing.

Types

type Config

type Config struct{}

Config configures the components.

type ConstructClient

type ConstructClient[SC any] func(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SC

ConstructClient is a funct signature that constructs a client.

type ConstructHandler

type ConstructHandler[SH any] func(svc SH, opts ...connect.HandlerOption) (string, http.Handler)

ConstructHandler defines the type for constructing a connectrpc service handler.

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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