-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable scaffolding for host builds (#1750)
* feat: enable scaffolding in builder * fix a few typos * error text formatting Co-authored-by: Lance Ball <lball@redhat.com> * error text formatting Co-authored-by: Lance Ball <lball@redhat.com> * remove test job stop defer --------- Co-authored-by: Lance Ball <lball@redhat.com>
- Loading branch information
Showing
20 changed files
with
773 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package f | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
"fmt" | ||
"net/http" | ||
"time" | ||
) | ||
|
||
type F struct { | ||
Created time.Time | ||
} | ||
|
||
func New() *F { | ||
return &F{time.Now()} | ||
} | ||
|
||
func (f *F) Handle(_ context.Context, w http.ResponseWriter, r *http.Request) { | ||
fmt.Println("Request received") | ||
fmt.Fprintf(w, "Request received\n") | ||
} | ||
|
||
func (f *F) Ready(ctx context.Context) (bool, error) { | ||
// Emulate a function which does not start immediately | ||
if time.Now().After(f.Created.Add(600 * time.Millisecond)) { | ||
return true, nil | ||
} | ||
return false, errors.New("still starting up") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module function | ||
|
||
go 1.17 |
Oops, something went wrong.