service

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package service implements the functions, types, and interfaces for the module.

Package service implements the functions, types, and interfaces for the module.

Package service implements the functions, types, and interfaces for the module.

Package service implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const DefaultHostEnv = "HOST"
View Source
const DefaultName = "default"
View Source
const DefaultTimeout = 5 * time.Second

Variables

View Source
var DefaultBuilder = NewBuilder()

DefaultBuilder is the default instance of the middlewareBuilder .

View Source
var (
	ErrServiceNotFound = errors.New("service not found")
)

Functions

This section is empty.

Types

type ClientGRPCFactory added in v0.2.0

type ClientGRPCFactory interface {
	New(context.Context, *configv1.Service, ...GRPCOption) (*GRPCClient, error)
}

type ClientHTTPFactory added in v0.2.0

type ClientHTTPFactory interface {
	New(context.Context, *configv1.Service, ...HTTPOption) (*HTTPClient, error)
}

type EndpointFunc added in v0.1.0

type EndpointFunc = func(scheme string, host string, addr string) (string, error)

type Factory added in v0.1.15

type Factory interface {
	NewGRPCServer(*configv1.Service, ...GRPCOption) (*GRPCServer, error)
	NewHTTPServer(*configv1.Service, ...HTTPOption) (*HTTPServer, error)
	NewGRPCClient(context.Context, *configv1.Service, ...GRPCOption) (*GRPCClient, error)
	NewHTTPClient(context.Context, *configv1.Service, ...HTTPOption) (*HTTPClient, error)
}

Factory is an interface that defines a method for creating a new buildImpl.

type GRPCClient

type GRPCClient = grpc.ClientConn

GRPCClient define the gRPC client interface

type GRPCClientOption added in v0.0.4

type GRPCClientOption = transgrpc.ClientOption

GRPCClientOption define the gRPC client options

type GRPCOption added in v0.1.56

type GRPCOption = grpc.Option

GRPCOption is the type for gRPC option settings.

type GRPCRegistrar added in v0.2.1

type GRPCRegistrar interface {
	RegisterGRPC(context.Context, *GRPCServer)
}

type GRPCServer

type GRPCServer = transgrpc.Server

GRPCServer define the gRPC server interface

type GRPCServerOption added in v0.0.4

type GRPCServerOption = transgrpc.ServerOption

GRPCServerOption define the gRPC server options

type HTTPClient

type HTTPClient = transhttp.Client

HTTPClient define the HTTP client interface

type HTTPClientOption added in v0.0.4

type HTTPClientOption = transhttp.ClientOption

HTTPClientOption define the HTTP client options

type HTTPOption added in v0.1.56

type HTTPOption = http.Option

HTTPOption is the type for HTTP option settings.

type HTTPRegistrar added in v0.2.1

type HTTPRegistrar interface {
	RegisterHTTP(context.Context, *HTTPServer)
}

type HTTPServer

type HTTPServer = transhttp.Server

HTTPServer define the HTTP server interface

type HTTPServerOption added in v0.0.4

type HTTPServerOption = transhttp.ServerOption

HTTPServerOption define the HTTP server options

type Option added in v0.1.0

type Options added in v0.2.0

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

func (Options) ToGRPC added in v0.2.0

func (o Options) ToGRPC() GRPCOption

func (Options) ToHTTP added in v0.2.0

func (o Options) ToHTTP() http.Option

type RegisterFunc added in v0.2.1

type RegisterFunc[T any] func(context.Context, *T)

RegisterFunc register a service

func (RegisterFunc[T]) Register added in v0.2.1

func (f RegisterFunc[T]) Register(ctx context.Context, t *T)

type RegisterGRPCFunc added in v0.2.1

type RegisterGRPCFunc = RegisterFunc[GRPCServer]

RegisterGRPCFunc register a gRPC server

type RegisterHTTPFunc added in v0.2.1

type RegisterHTTPFunc = RegisterFunc[HTTPServer]

RegisterHTTPFunc register a HTTP server

type Registrar added in v0.2.1

type Registrar[T any] interface {
	Register(context.Context, *T)
}

type ServerBuilder added in v0.2.0

type ServerBuilder interface {
	factory.Registry[ServerFactory]
	DefaultBuild(*configv1.Service, ...ServerOption) (transport.Server, error)
	Build(string, *configv1.Service, ...ServerOption) (transport.Server, error)
}

func NewBuilder added in v0.1.16

func NewBuilder() ServerBuilder

type ServerFactory added in v0.2.0

type ServerFactory interface {
	New(*configv1.Service, ...ServerOption) (transport.Server, error)
}
var DefaultServiceFactory ServerFactory = &factoryImpl{}

DefaultServiceFactory is the default instance of the buildImpl.

type ServerOption added in v0.2.0

type ServerOption = func(o *Options)

func WithGRPC added in v0.1.0

func WithGRPC(opts ...GRPCOption) ServerOption

func WithHTTP added in v0.1.0

func WithHTTP(opts ...HTTPOption) ServerOption

type ServerRegistrar added in v0.2.1

type ServerRegistrar interface {
	Register(context.Context, any)
	RegisterHTTP(context.Context, *HTTPServer)
	RegisterGRPC(context.Context, *GRPCServer)
}

type Service added in v0.1.15

type Service struct{}

Directories

Path Synopsis
Package endpoint implements the functions, types, and interfaces for the module.
Package endpoint implements the functions, types, and interfaces for the module.
Package grpc implements the functions, types, and interfaces for the module.
Package grpc implements the functions, types, and interfaces for the module.
Package http implements the functions, types, and interfaces for the module.
Package http implements the functions, types, and interfaces for the module.
Package selector implements the functions, types, and interfaces for the module.
Package selector implements the functions, types, and interfaces for the module.
Package service implements the functions, types, and interfaces for the module.
Package service implements the functions, types, and interfaces for the module.

Jump to

Keyboard shortcuts

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