dataapi

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package dataapi provides a Data API wrapper, which allows FerretDB to be used over HTTP instead of MongoDB wire protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenOpts

type ListenOpts struct {
	L       *slog.Logger
	Handler middleware.Handler
	TCPAddr string
	Auth    bool
}

ListenOpts represents Listen options.

type Listener

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

Listener represents dataapi listener.

func Listen

func Listen(opts *ListenOpts) (*Listener, error)

Listen creates a new dataapi handler and starts listener on the given TCP address.

func (*Listener) Addr added in v2.5.0

func (lis *Listener) Addr() net.Addr

Addr returns TCP listener's address. It can be used to determine an actually used port, if it was zero.

func (*Listener) Run

func (lis *Listener) Run(ctx context.Context)

Run runs dataapi handler until ctx is canceled.

It exits when handler is stopped and listener closed.

Directories

Path Synopsis
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
Package server provides a Data API server handlers.
Package server provides a Data API server handlers.

Jump to

Keyboard shortcuts

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