Skip to content

Commit

Permalink
client struct tags
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Siwiec <rizzza@users.noreply.github.com>
  • Loading branch information
rizzza committed Oct 18, 2023
1 parent fceeb43 commit 7de13d9
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions pkg/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,69 @@ import "encoding/json"

// OriginNode is a struct that represents the OriginNode GraphQL type
type OriginNode struct {
ID string
Name string
Target string
PortNumber int64
Weight int64
Active bool
ID string `graphql:"id" json:"id"`
Name string `graphql:"name" json:"name"`
Target string `graphql:"target" json:"target"`
PortNumber int64 `graphql:"portNumber" json:"portNumber"`
Weight int64 `graphql:"weight" json:"weight"`
Active bool `graphql:"active" json:"active"`
}

// OriginEdges is a struct that represents the OriginEdges GraphQL type
type OriginEdges struct {
Node OriginNode
Node OriginNode `graphql:"node" json:"node"`
}

// Origins is a struct that represents the Origins GraphQL type
type Origins struct {
Edges []OriginEdges
Edges []OriginEdges `graphql:"edges" json:"edges"`
}

// Pool is a struct that represents the Pool GraphQL type
type Pool struct {
ID string
Name string
Protocol string
Origins Origins
ID string `graphql:"id"`
Name string `graphql:"name" json:"name"`
Protocol string `graphql:"protocol" json:"protocol"`
Origins Origins `graphql:"origins" json:"origins"`
}

// PortNode is a struct that represents the PortNode GraphQL type
type PortNode struct {
ID string
Name string
Number int64
Pools []Pool
ID string `graphql:"id" json:"id"`
Name string `graphql:"name" json:"name"`
Number int64 `graphql:"number" json:"number"`
Pools []Pool `graphql:"pools" json:"pools"`
}

// PortEdges is a struct that represents the PortEdges GraphQL type
type PortEdges struct {
Node PortNode
Node PortNode `graphql:"node" json:"node"`
}

// Ports is a struct that represents the Ports GraphQL type
type Ports struct {
Edges []PortEdges
Edges []PortEdges `graphql:"edges" json:"edges"`
}

// OwnerNode is a struct that represents the OwnerNode GraphQL type
type OwnerNode struct {
ID string
ID string `graphql:"id" json:"id"`
}

// LocationNode is a struct that represents the LocationNode GraphQL type
type LocationNode struct {
ID string
ID string `graphql:"id" json:"id"`
}

// LoadBalancer is a struct that represents the LoadBalancer GraphQL type
type LoadBalancer struct {
ID string
Name string
Owner OwnerNode
Location LocationNode
IPAddresses []IPAddress `graphql:"IPAddresses" json:"IPAddresses"`
Metadata Metadata `graphql:"metadata" json:"metadata"`
Ports Ports
ID string `graphql:"id" json:"id"`
Name string `graphql:"name" json:"name"`
Owner OwnerNode `graphql:"owner" json:"owner"`
Location LocationNode `graphql:"location" json:"location"`
IPAddresses []IPAddress `graphql:"IPAddresses" json:"IPAddresses"`
Metadata Metadata `graphql:"metadata" json:"metadata"`
Ports Ports `graphql:"ports" json:"ports"`
}

// GetLoadBalancer is a struct that represents the GetLoadBalancer GraphQL query
Expand All @@ -76,33 +76,33 @@ type GetLoadBalancer struct {

// IPAddress is a struct that represents the IPAddress GraphQL type
type IPAddress struct {
ID string
IP string
Reserved bool
ID string `graphql:"id" json:"id"`
IP string `graphql:"ip" json:"ip"`
Reserved bool `graphql:"reserved" json:"reserved"`
}

// MetadataStatusNode is a struct that represents the Metadata status node GraphQL type
type MetadataStatusNode struct {
ID string `graphql:"id"`
ID string `graphql:"id" json:"id"`
Data json.RawMessage `graphql:"data"`
Source string `graphql:"source"`
StatusNamespaceID string `graphql:"statusNamespaceID"`
Source string `graphql:"source" json:"source"`
StatusNamespaceID string `graphql:"statusNamespaceID" json:"statusNamespaceID"`
}

// MetadataStatusEdges is a struct that represents the Metadata status edges GraphQL type
type MetadataStatusEdges struct {
Node MetadataStatusNode
Node MetadataStatusNode `graphql:"node" json:"node"`
}

// MetadataStatuses is a struct that represents the Metadata statuses GraphQL type
type MetadataStatuses struct {
Edges []MetadataStatusEdges
Edges []MetadataStatusEdges `graphql:"edges" json:"edges"`
}

// Metadata is a struct that represents the metadata GraphQL type
type Metadata struct {
ID string `graphql:"id"`
NodeID string `graphql:"nodeID"`
ID string `graphql:"id" json:"id"`
NodeID string `graphql:"nodeID" json:"nodeID"`
Statuses MetadataStatuses `graphql:"statuses" json:"statuses"`
}

Expand All @@ -114,7 +114,7 @@ type Metadata struct {
// Name string
// IPAddresses {
// id string
// ip
// ip string
// }
// metadata struct {
// id string
Expand Down

0 comments on commit 7de13d9

Please sign in to comment.