Skip to content

Commit

Permalink
Move Signup* types to their own package
Browse files Browse the repository at this point in the history
Needed in order to import them from several modules.

Signed-off-by: gbenhaim <[email protected]>
  • Loading branch information
gbenhaim committed Sep 5, 2024
1 parent 4f3d064 commit a8c6101
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
21 changes: 5 additions & 16 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,9 @@ import (

crt "github.com/codeready-toolchain/api/api/v1alpha1"
"k8s.io/client-go/kubernetes"
)

type SignupStatusReason = string

var SignedUp SignupStatusReason = "SignedUp"

type SignupStatus struct {
Ready bool `json:"ready"`
Reason SignupStatusReason `json:"reason"`
}

type Signup struct {
SignupStatus SignupStatus `json:"status"`
}
"github.com/konflux-ci/workspace-manager/pkg/api/v1alpha1"

Check failure on line 26 in cmd/main.go

View check run for this annotation

Red Hat Konflux / Red Hat Konflux / workspace-manager-on-pull-request

cmd/main.go#L26

no required module provides package github.com/konflux-ci/workspace-manager/pkg/api/v1alpha1; to add it:
)

var (
scheme = runtime.NewScheme()
Expand Down Expand Up @@ -215,10 +204,10 @@ func main() {
})

e.GET("/api/v1/signup", func(c echo.Context) error {
resp := &Signup{
SignupStatus: SignupStatus{
resp := &v1alpha1.Signup{
SignupStatus: v1alpha1.SignupStatus{
Ready: true,
Reason: SignedUp,
Reason: v1alpha1.SignedUp,
},
}
return c.JSON(http.StatusOK, resp)
Expand Down
14 changes: 14 additions & 0 deletions pkg/api/v1alpha1/usersignup_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package v1alpha1

type SignupStatusReason = string

var SignedUp SignupStatusReason = "SignedUp"

type SignupStatus struct {
Ready bool `json:"ready"`
Reason SignupStatusReason `json:"reason"`
}

type Signup struct {
SignupStatus SignupStatus `json:"status"`
}

0 comments on commit a8c6101

Please sign in to comment.