Documentation
¶
Index ¶
- func CORS(next http.Handler) http.Handler
- func Command() *cobra.Command
- func RunServer(flags *Flags) error
- func Setup(mux *http.ServeMux, eng *engine.Engine, key, secret, data, baseURL string)
- type FakeHandler
- func (h FakeHandler) Account(w http.ResponseWriter, r *http.Request)
- func (h FakeHandler) CreateToken(w http.ResponseWriter, r *http.Request)
- func (h FakeHandler) DeleteFile(w http.ResponseWriter, _ *http.Request, id string)
- func (h FakeHandler) DeleteToken(w http.ResponseWriter, _ *http.Request, id string)
- func (h FakeHandler) DeleteTrace(w http.ResponseWriter, _ *http.Request, id string)
- func (h FakeHandler) Ping(w http.ResponseWriter, r *http.Request)
- func (h FakeHandler) ProcessFile(w http.ResponseWriter, r *http.Request)
- func (h FakeHandler) ProcessFileAsync(w http.ResponseWriter, r *http.Request)
- func (h FakeHandler) ProcessFileFetch(w http.ResponseWriter, r *http.Request)
- func (h FakeHandler) RetrieveFile(w http.ResponseWriter, _ *http.Request, id string)
- func (h FakeHandler) RetrieveToken(w http.ResponseWriter, _ *http.Request, id string)
- func (h FakeHandler) RetrieveTrace(w http.ResponseWriter, _ *http.Request, id string)
- type Flags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORS ¶ added in v1.6.0
CORS wraps a handler so browser-based clients can call the mock from a different origin. The header set mirrors what the real Scanii API serves in production. OPTIONS preflight requests are answered with 200 + the Access-Control headers and do not reach the wrapped handler.
Types ¶
type FakeHandler ¶
type FakeHandler struct {
// contains filtered or unexported fields
}
func (FakeHandler) Account ¶
func (h FakeHandler) Account(w http.ResponseWriter, r *http.Request)
func (FakeHandler) CreateToken ¶
func (h FakeHandler) CreateToken(w http.ResponseWriter, r *http.Request)
func (FakeHandler) DeleteFile ¶ added in v1.11.0
func (h FakeHandler) DeleteFile(w http.ResponseWriter, _ *http.Request, id string)
func (FakeHandler) DeleteToken ¶
func (h FakeHandler) DeleteToken(w http.ResponseWriter, _ *http.Request, id string)
func (FakeHandler) DeleteTrace ¶ added in v1.12.0
func (h FakeHandler) DeleteTrace(w http.ResponseWriter, _ *http.Request, id string)
func (FakeHandler) Ping ¶
func (h FakeHandler) Ping(w http.ResponseWriter, r *http.Request)
func (FakeHandler) ProcessFile ¶
func (h FakeHandler) ProcessFile(w http.ResponseWriter, r *http.Request)
func (FakeHandler) ProcessFileAsync ¶
func (h FakeHandler) ProcessFileAsync(w http.ResponseWriter, r *http.Request)
func (FakeHandler) ProcessFileFetch ¶
func (h FakeHandler) ProcessFileFetch(w http.ResponseWriter, r *http.Request)
func (FakeHandler) RetrieveFile ¶
func (h FakeHandler) RetrieveFile(w http.ResponseWriter, _ *http.Request, id string)
func (FakeHandler) RetrieveToken ¶
func (h FakeHandler) RetrieveToken(w http.ResponseWriter, _ *http.Request, id string)
func (FakeHandler) RetrieveTrace ¶ added in v1.4.0
func (h FakeHandler) RetrieveTrace(w http.ResponseWriter, _ *http.Request, id string)
type Flags ¶
type Flags struct {
Address string
Engine string
Key string
Secret string
Data string
ReadyChan chan bool
// CallBackWait overrides the engine's callback delay. Nil means the engine
// config decides, which is what keeps an unpassed flag from overriding a
// value set in an --engine file.
CallBackWait *time.Duration
}
Flags holds configuration for the mock server.
Click to show internal directories.
Click to hide internal directories.