Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98d85810f3 | |||
| 3fc1191f6e | |||
| 52793ac244 | |||
| f8a1ae841d | |||
| 9d424742d6 | |||
| a9b73a6536 | |||
| 95584eb407 | |||
| ce7e2bc75a | |||
| 4bedc5d926 | |||
| ea7f98f8bb | |||
| bbdce9b25a | |||
| 1d75153698 | |||
| c177133daf | |||
| dad915f2ec | |||
| 54e4006d0d | |||
| 9cb590bf7a | |||
| 70c41dab96 | |||
| 99ac0a83c6 |
@@ -61,17 +61,26 @@ 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(),
|
||||
ID: s.GetID(),
|
||||
// Kind: consul.ServiceKindConnectProxy,
|
||||
Name: s.Name,
|
||||
Address: s.Address,
|
||||
Port: s.port,
|
||||
Tags: s.getTags(),
|
||||
Connect: &consul.AgentServiceConnect{SidecarService: &consul.AgentServiceRegistration{}},
|
||||
Connect: &consul.AgentServiceConnect{
|
||||
Native: true,
|
||||
// SidecarService: &consul.AgentServiceRegistration{
|
||||
// Port: s.port,
|
||||
// },
|
||||
},
|
||||
// Proxy: &consul.AgentServiceConnectProxyConfig{
|
||||
// DestinationServiceName: s.Name,
|
||||
// },
|
||||
Check: &consul.AgentServiceCheck{
|
||||
TTL: s.ttl.String(),
|
||||
Status: "passing",
|
||||
@@ -111,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