Skip to content

Commit

Permalink
beginning work on scope crd
Browse files Browse the repository at this point in the history
  • Loading branch information
ebauman committed Jun 7, 2023
1 parent e81fe61 commit 3057c93
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/apis/hobbyfarm.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,23 @@ type SettingList struct {

Items []Setting `json:"items"`
}

// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type Scope struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

DisplayName string `json:"displayName"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ScopeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []Scope `json:"items"`
}
5 changes: 5 additions & 0 deletions pkg/settingserver/settingserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (s SettingServer) SetupRoutes(r *mux.Router) {
r.HandleFunc("/setting/list/{scope}", s.ListFunc).Methods(http.MethodGet)
r.HandleFunc("/setting/update/{setting_id}", s.UpdateFunc).Methods(http.MethodPut)
r.HandleFunc("/setting/updatecollection", s.UpdateCollection).Methods(http.MethodPut)
r.HandleFunc("/scope/list", s.ListScopeFunc).Methods(http.MethodGet)
}

func (s SettingServer) ListFunc(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -213,3 +214,7 @@ func (s SettingServer) update(w http.ResponseWriter, r *http.Request, setting Pr

return true
}

func (s SettingServer) ListScopeFunc(w http.ResponseWriter, r *http.Request) {

}

0 comments on commit 3057c93

Please sign in to comment.