httpc

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoHttpServiceInContext  = errors.New("no http service in context")
	ErrInvalidServiceInContext = errors.New("invalid http service in context")
)

Functions

func MustClient

func MustClient(ctx context.Context) *http.Client

Types

type Option added in v0.0.26

type Option func(*Service)

func WithAuthEditor added in v0.0.35

func WithAuthEditor(ed authcore.RequestEditor) Option

WithAuthEditor Install an auth editor transport now

func WithCookieJar added in v0.0.35

func WithCookieJar() Option

WithCookieJar Ensure cookie jar (needed for XSRF)

func WithTimeout added in v0.0.26

func WithTimeout(d time.Duration) Option

func WithTimeoutString added in v0.0.26

func WithTimeoutString(v string) Option

type Service

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

func FromContext

func FromContext(ctx context.Context) (*Service, error)

func New

func New(cfg *config.Config, log *slog.Logger, opts ...Option) (*Service, error)

func (*Service) Client

func (s *Service) Client() *http.Client

func (*Service) InstallAuthEditor added in v0.0.35

func (s *Service) InstallAuthEditor(ed authcore.RequestEditor)

func (*Service) InstallCookieJar added in v0.0.35

func (s *Service) InstallCookieJar() error

func (*Service) ToContext

func (s *Service) ToContext(ctx context.Context) context.Context

func (*Service) UseClient added in v0.0.35

func (s *Service) UseClient(c *http.Client)

Jump to

Keyboard shortcuts

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