timeout

package
v0.0.0-...-0c438d6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package timeout provides timeout handling for go-micro services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCallWrapper

func NewCallWrapper(opts ...Option) client.CallWrapper

NewCallWrapper creates a new call wrapper for timeout handling

func NewClientWrapper

func NewClientWrapper(opts ...Option) client.Wrapper

NewClientWrapper creates a new client wrapper for timeout handling

func NewHandlerWrapper

func NewHandlerWrapper(opts ...Option) server.HandlerWrapper

NewHandlerWrapper creates a new handler wrapper for request timeout handling

Types

type Config

type Config struct {
	// Timeout value
	Timeout *time.Duration `yaml:"timeout,omitempty"`
}

Config holds timeout configuration settings

type Option

type Option func(*Options)

Option function for setting options

func WithConfig

func WithConfig(cfg *Config) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeoutSeconds sets the timeout

type Options

type Options struct {
	// Timeout value
	Timeout time.Duration
}

Options for the timeout middleware

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns default options

Source Files

  • options.go
  • wrappers.go

Jump to

Keyboard shortcuts

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