github.com/grafana/pyroscope@v1.18.0/pkg/metastore/discovery/kuberesolver/models.go (about)

     1  package kuberesolver
     2  
     3  type EventType string
     4  
     5  const (
     6  	Added    EventType = "ADDED"
     7  	Modified EventType = "MODIFIED"
     8  	Deleted  EventType = "DELETED"
     9  	Error    EventType = "ERROR"
    10  )
    11  
    12  // Event represents a single event to a watched resource.
    13  type Event struct {
    14  	Type   EventType `json:"type"`
    15  	Object Endpoints `json:"object"`
    16  }
    17  
    18  type Endpoints struct {
    19  	Kind       string   `json:"kind"`
    20  	ApiVersion string   `json:"apiVersion"`
    21  	Metadata   Metadata `json:"metadata"`
    22  	Subsets    []Subset `json:"subsets"`
    23  }
    24  
    25  type Metadata struct {
    26  	Name            string            `json:"name"`
    27  	Namespace       string            `json:"namespace"`
    28  	ResourceVersion string            `json:"resourceVersion"`
    29  	Labels          map[string]string `json:"labels"`
    30  }
    31  
    32  type Subset struct {
    33  	Addresses []Address `json:"addresses"`
    34  	Ports     []Port    `json:"ports"`
    35  }
    36  
    37  type Address struct {
    38  	IP        string           `json:"ip"`
    39  	TargetRef *ObjectReference `json:"targetRef,omitempty"`
    40  }
    41  
    42  type ObjectReference struct {
    43  	Kind      string `json:"kind"`
    44  	Name      string `json:"name"`
    45  	Namespace string `json:"namespace"`
    46  }
    47  type Port struct {
    48  	Name string `json:"name"`
    49  	Port int    `json:"port"`
    50  }