123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package consul
- var _ DefaultServiceInstance = (*serviceInstance)(nil)
- type DefaultServiceInstance interface {
- GetInstanceID() string
- GetServiceID() string
- GetHost() string
- GetPort() int
- IsSecure() bool
- GetMetadata() map[string]string
- }
- type serviceInstance struct {
- InstanceID string
- ServiceID string
- Host string
- Port int
- Secure bool
- Metadata map[string]string
- }
- func NewDefaultServiceInstance(serviceID string, host string, port int, secure bool,
- metadata map[string]string, instanceID string) (DefaultServiceInstance, error) {
- return &serviceInstance{
- InstanceID: instanceID,
- ServiceID: serviceID,
- Host: host,
- Port: port,
- Secure: secure,
- Metadata: metadata,
- }, nil
- }
- func (serviceInstance serviceInstance) GetInstanceID() string {
- return serviceInstance.InstanceID
- }
- func (serviceInstance serviceInstance) GetServiceID() string {
- return serviceInstance.ServiceID
- }
- func (serviceInstance serviceInstance) GetHost() string {
- return serviceInstance.Host
- }
- func (serviceInstance serviceInstance) GetPort() int {
- return serviceInstance.Port
- }
- func (serviceInstance serviceInstance) IsSecure() bool {
- return serviceInstance.Secure
- }
- func (serviceInstance serviceInstance) GetMetadata() map[string]string {
- return serviceInstance.Metadata
- }
|