2022-11-01 19:03:23 +00:00
|
|
|
package service
|
|
|
|
|
2023-01-11 21:34:27 +00:00
|
|
|
import "github.com/hashicorp/consul/api"
|
2023-01-04 20:28:15 +00:00
|
|
|
|
2022-11-01 19:03:23 +00:00
|
|
|
// Service represents a process that will be registered with the
|
|
|
|
// Consul catalog, including Consul components such as sidecars and gateways
|
|
|
|
type Service interface {
|
2023-01-04 20:28:15 +00:00
|
|
|
// Export a service to the peering cluster
|
|
|
|
Export(partition, peer string, client *api.Client) error
|
2023-01-20 22:02:44 +00:00
|
|
|
GetAddr() (string, int)
|
2023-01-18 21:13:55 +00:00
|
|
|
GetAdminAddr() (string, int)
|
2023-01-20 22:02:44 +00:00
|
|
|
GetLogs() (string, error)
|
|
|
|
GetName() string
|
|
|
|
GetServiceName() string
|
|
|
|
Start() (err error)
|
|
|
|
Terminate() error
|
2023-01-27 16:25:48 +00:00
|
|
|
Restart() error
|
2022-11-01 19:03:23 +00:00
|
|
|
}
|