httpcell

package
v0.0.0-...-36bb858 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MPL-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CurrentHeader = "X-Current"
	MaxSize       = 1 << 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

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

func New

func New(spec Spec) *Cell

func (*Cell) CAS

func (c *Cell) CAS(ctx context.Context, actual *[]byte, cur, next []byte) (bool, error)

func (*Cell) Copy

func (c *Cell) Copy(dst *[]byte, src []byte)

func (*Cell) Equals

func (c *Cell) Equals(a, b []byte) bool

func (*Cell) Load

func (c *Cell) Load(ctx context.Context, dst *[]byte) error

func (*Cell) MaxSize

func (c *Cell) MaxSize() int

func (*Cell) URL

func (c *Cell) URL() string

type Server

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

func NewServer

func NewServer() *Server

func (*Server) CreateCell

func (s *Server) CreateCell(name string) Spec

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, laddr string) (err error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) URL

func (s *Server) URL() string

type Spec

type Spec struct {
	URL     string
	Headers map[string]string
}

Jump to

Keyboard shortcuts

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