Documentation
¶
Overview ¶
Package sourcestub provides a small OpenAI-shaped service for source-routing tests. It models a direct service, not a router with serving lanes.
Index ¶
- type Request
- type Server
- func (s *Server) Close()
- func (s *Server) Hang(delay time.Duration)
- func (s *Server) Healthy()
- func (s *Server) Listingless()
- func (s *Server) Refuse(status int, body string)
- func (s *Server) RefuseCompletion(status int, body string)
- func (s *Server) Requests() []Request
- func (s *Server) URL() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
Method string
Path string
Host string
Bearer string
Agent string
Body []byte
}
Request is one request observed by the service.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a switchable fake direct model service.
func (*Server) Listingless ¶
func (s *Server) Listingless()
Listingless makes only GET /models answer 404. Completions remain healthy, which models vendors whose key can be proved only by a one-token call.
func (*Server) RefuseCompletion ¶
RefuseCompletion leaves the listing healthy and refuses only generation. It models an authenticated key whose account cannot fund a billable call.
Click to show internal directories.
Click to hide internal directories.