orders

package
v2.9.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(router Router, store Store)

RegisterRoutes wires the store-backed HTTP handlers.

Types

type SQLStore

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

SQLStore persists orders in a relational database.

func NewSQLStore

func NewSQLStore(db *sql.DB) *SQLStore

NewSQLStore builds a repository around an existing database handle.

func (*SQLStore) Find

func (s *SQLStore) Find(ctx context.Context, id string) (Order, error)

Find loads one order and maps missing rows to a domain error.

func (*SQLStore) Save

func (s *SQLStore) Save(ctx context.Context, order Order) error

Save persists the current aggregate state in a transaction.

type Server

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

Server owns the HTTP handlers.

func (*Server) Handle

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

Handle serves one order.

type Store

type Store interface {
	Find(ctx context.Context, id string) (Order, error)
	Save(ctx context.Context, order Order) error
}

Store defines the persistence operations required by the order service.

Jump to

Keyboard shortcuts

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