routeoverride

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(opts Options) (http.Handler, error)

NewHandler returns the protected routing-override resource.

Types

type Handler

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

Handler is the generation-bound routing-override HTTP resource.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	Service      routeoverride.CommandService
	MaxBodyBytes int64
	Log          *slog.Logger
}

Options configures the GET/PUT/DELETE handler.

type PutBody

type PutBody struct {
	Selector string `json:"selector"`
}

PutBody is the PUT JSON document. Exactly one field is accepted.

type StateDTO

type StateDTO struct {
	ALegID    string     `json:"a_leg_id"`
	Active    bool       `json:"active"`
	Selector  string     `json:"selector,omitempty"`
	Revision  int64      `json:"revision"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

StateDTO is the protected GET/PUT/DELETE response. Selector is omitted when inactive. UpdatedAt is omitted only for never-mutated revision 0.

func StateToDTO

func StateToDTO(s routeoverride.State) StateDTO

StateToDTO maps domain state onto the wire DTO.

Jump to

Keyboard shortcuts

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