mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-23 17:41:05 +01:00
- These changes makes the API incombatible with previous versions - Added new types for error handling, success responses, and health checks. - Updated health check logic to utilize the new types for better clarity and structure. - Refactored existing handlers to improve response consistency and error handling. - Updated Makefile to include a new target for generating API types from Swagger. - Updated "new agent" API to respond an encrypted cert pair
35 lines
745 B
Go
35 lines
745 B
Go
package provider
|
|
|
|
import (
|
|
"github.com/rs/zerolog"
|
|
"github.com/yusing/go-proxy/agent/pkg/agent"
|
|
"github.com/yusing/go-proxy/internal/gperr"
|
|
"github.com/yusing/go-proxy/internal/route"
|
|
"github.com/yusing/go-proxy/internal/watcher"
|
|
)
|
|
|
|
type AgentProvider struct {
|
|
*agent.AgentConfig
|
|
docker ProviderImpl
|
|
}
|
|
|
|
func (p *AgentProvider) ShortName() string {
|
|
return p.AgentConfig.Name
|
|
}
|
|
|
|
func (p *AgentProvider) NewWatcher() watcher.Watcher {
|
|
return p.docker.NewWatcher()
|
|
}
|
|
|
|
func (p *AgentProvider) IsExplicitOnly() bool {
|
|
return p.docker.IsExplicitOnly()
|
|
}
|
|
|
|
func (p *AgentProvider) loadRoutesImpl() (route.Routes, gperr.Error) {
|
|
return p.docker.loadRoutesImpl()
|
|
}
|
|
|
|
func (p *AgentProvider) Logger() *zerolog.Logger {
|
|
return p.docker.Logger()
|
|
}
|