Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Singh <[email protected]>
  • Loading branch information
theBeginner86 committed Oct 14, 2023
1 parent 9b9f1a1 commit 71804eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
40 changes: 20 additions & 20 deletions models/meshmodel/core/v1alpha1/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ package v1alpha1
import "github.com/google/uuid"

type MesheryHostsDisplay struct {
ID uuid.UUID `json:"id"`
Hostname string `json:"hostname"`
Port int `json:"port"`
Summary HostIndividualCount `json:"summary"`
ID uuid.UUID `json:"id"`
Hostname string `json:"hostname"`
Port int `json:"port"`
Summary EntitySummary `json:"summary"`
}
type HostIndividualCount struct {
type EntitySummary struct {
Models int64 `json:"models"`
Components int64 `json:"components"`
Relationships int64 `json:"relationships"`
Policies int64 `json:"policies"`
}
type MesheryHostSummaryDB struct {
HostID uuid.UUID `json:"-" gorm:"id"`
Hostname string `json:"-" gorm:"hostname"`
Port int `json:"-" gorm:"port"`
Models int64 `json:"-" gorm:"models"`
Components int64 `json:"-" gorm:"components"`
Relationships int64 `json:"-" gorm:"relationships"`
Policies int64 `json:"-" gorm:"policies"`
Hostname string `json:"-" gorm:"hostname"`
Port int `json:"-" gorm:"port"`
Models int64 `json:"-" gorm:"models"`
Components int64 `json:"-" gorm:"components"`
Relationships int64 `json:"-" gorm:"relationships"`
Policies int64 `json:"-" gorm:"policies"`
}

type HostFilter struct {
Name string
Greedy bool //when set to true - instead of an exact match, name will be prefix matched
Trim bool //when set to true - the schema is not returned
DisplayName string
Version string
Sort string //asc or desc. Default behavior is asc
OrderOn string
Limit int //If 0 or unspecified then all records are returned and limit is not used
Offset int
Name string
Greedy bool //when set to true - instead of an exact match, name will be prefix matched
Trim bool //when set to true - the schema is not returned
DisplayName string
Version string
Sort string //asc or desc. Default behavior is asc
OrderOn string
Limit int //If 0 or unspecified then all records are returned and limit is not used
Offset int
}
4 changes: 2 additions & 2 deletions models/meshmodel/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (rm *RegistryManager) GetRegistrants(f *v1alpha1.HostFilter) ([]v1alpha1.Me
} else {
query = query.Order("hostname")
}

query = query.Offset(f.Offset)
if f.Limit != 0 {
query = query.Limit(f.Limit)
Expand All @@ -249,7 +249,7 @@ func (rm *RegistryManager) GetRegistrants(f *v1alpha1.HostFilter) ([]v1alpha1.Me
ID: r.HostID,
Hostname: HostnameToPascalCase(r.Hostname),
Port: r.Port,
Summary: v1alpha1.HostIndividualCount{
Summary: v1alpha1.EntitySummary{
Models: r.Models,
Components: r.Components,
Relationships: r.Relationships,
Expand Down

0 comments on commit 71804eb

Please sign in to comment.