Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98d85810f3 | |||
| 3fc1191f6e | |||
| 52793ac244 | |||
| f8a1ae841d | |||
| 9d424742d6 | |||
| a9b73a6536 | |||
| 95584eb407 | |||
| ce7e2bc75a | |||
| 4bedc5d926 | |||
| ea7f98f8bb |
@@ -61,24 +61,25 @@ func (s *Service) GetID() string {
|
||||
}
|
||||
|
||||
func (s *Service) GetFullAddr() string {
|
||||
return fmt.Sprintf("http://%s:%d/", s.domain, s.port)
|
||||
return fmt.Sprintf("https://%s:%d/", s.domain, s.port)
|
||||
}
|
||||
|
||||
func (s *Service) Register() error {
|
||||
def := &consul.AgentServiceRegistration{
|
||||
ID: s.GetID(),
|
||||
Kind: consul.ServiceKindConnectProxy,
|
||||
ID: s.GetID(),
|
||||
// Kind: consul.ServiceKindConnectProxy,
|
||||
Name: s.Name,
|
||||
Address: s.Address,
|
||||
Port: s.port,
|
||||
Tags: s.getTags(),
|
||||
Connect: &consul.AgentServiceConnect{
|
||||
Native: true,
|
||||
// SidecarService: &consul.AgentServiceRegistration{
|
||||
// Port: s.port,
|
||||
// Port: s.port,
|
||||
// },
|
||||
},
|
||||
// Proxy: &consul.AgentServiceConnectProxyConfig{
|
||||
// DestinationServiceName: s.Name + "dupa",
|
||||
// DestinationServiceName: s.Name,
|
||||
// },
|
||||
Check: &consul.AgentServiceCheck{
|
||||
TTL: s.ttl.String(),
|
||||
@@ -119,10 +120,10 @@ func (s *Service) Unregister() error {
|
||||
func (s *Service) Connect() (*connect.Service, error) {
|
||||
// srvName := s.Name
|
||||
srvName := s.Name
|
||||
fmt.Printf("CONNECT SERVER: %s\n", srvName)
|
||||
svc, err := connect.NewService(srvName, s.client)
|
||||
s.connect = svc
|
||||
cnf := svc.ServerTLSConfig()
|
||||
fmt.Printf("CONNECT SERVER:: %s CONFIG:: %v\n", srvName, cnf)
|
||||
for k, c := range cnf.Certificates {
|
||||
fmt.Printf("CONNECT CERT %d: %v", k, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user