mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 13:56:27 +01:00
30 lines
455 B
Go
30 lines
455 B
Go
package genny
|
|
|
|
import (
|
|
"net/http"
|
|
"os/exec"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
type Results struct {
|
|
Files []File
|
|
Commands []*exec.Cmd
|
|
Requests []RequestResult
|
|
}
|
|
|
|
func (r Results) Find(s string) (File, error) {
|
|
for _, f := range r.Files {
|
|
if s == f.Name() {
|
|
return f, nil
|
|
}
|
|
}
|
|
return nil, errors.Errorf("%s not found", s)
|
|
}
|
|
|
|
type RequestResult struct {
|
|
Request *http.Request
|
|
Response *http.Response
|
|
Client *http.Client
|
|
Error error
|
|
}
|