This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtypes.go
42 lines (37 loc) · 1.53 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package servicefabric
import (
sf "github.com/jjcollinge/servicefabric"
)
// ServiceItemExtended provides a flattened view
// of the service with details of the application
// it belongs too and the replicas/partitions.
type ServiceItemExtended struct {
sf.ServiceItem
Application sf.ApplicationItem
Partitions []PartitionItemExtended
Labels map[string]string
}
// PartitionItemExtended provides a flattened view
// of a services partitions.
type PartitionItemExtended struct {
sf.PartitionItem
Replicas []sf.ReplicaItem
Instances []sf.InstanceItem
}
// sfClient is an interface for Service Fabric client's to implement.
// This is purposely a subset of the total Service Fabric API surface.
type sfClient interface {
GetApplications() (*sf.ApplicationItemsPage, error)
GetServices(appName string) (*sf.ServiceItemsPage, error)
GetPartitions(appName, serviceName string) (*sf.PartitionItemsPage, error)
GetReplicas(appName, serviceName, partitionName string) (*sf.ReplicaItemsPage, error)
GetInstances(appName, serviceName, partitionName string) (*sf.InstanceItemsPage, error)
GetServiceExtensionMap(service *sf.ServiceItem, app *sf.ApplicationItem, extensionKey string) (map[string]string, error)
GetServiceLabels(service *sf.ServiceItem, app *sf.ApplicationItem, prefix string) (map[string]string, error)
GetProperties(name string) (bool, map[string]string, error)
}
// replicaInstance interface provides a unified interface
// over replicas and instances.
type replicaInstance interface {
GetReplicaData() (string, *sf.ReplicaItemBase)
}