Documentation ¶
Index ¶
- Constants
- Variables
- func NewLogger(opts *Options) *logger
- type Options
- type Server
- func (s *Server) HandleAccounts(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleGlobalJetStream(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleHealthz(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleIdent(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleIdents(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandlePerm(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandlePerms(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandlePublish(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandlePublishV2(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleSnapshot(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleSnapshotV2(w http.ResponseWriter, req *http.Request)
- func (s *Server) HandleValidateSnapshotV2(w http.ResponseWriter, req *http.Request)
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) PublishSnapshot(name string) error
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) RunDataDirectoryRepair() error
- func (s *Server) SetupSignalHandler(ctx context.Context)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) TakeSnapshot(name string) error
- func (s *Server) VerifySnapshot() error
Constants ¶
View Source
const ( AppName = "nats-rest-config-proxy" DefaultPort = 4567 DefaultDataDir = "data" ResourcesDir = "resources" CurrentConfigDir = "current" SnapshotsDir = "snapshots" DefaultSnapshotName = "latest" )
Variables ¶
View Source
var (
Version = ""
)
Functions ¶
Types ¶
type Options ¶
type Options struct { // NoSignals marks whether to enable the signal handler. NoSignals bool // Debug enables debug messages. Debug bool // Trace enables trace messages. Trace bool // Host is the network to listen on. Host string // Port is the network port for the server. Port int // LogFile is the log file. LogFile string // DataDir is the directory for the data. DataDir string // NoLog discards the output of the logger. NoLog bool // NoColors disables the colors in the logger. NoColors bool // LogMaxSize is the maximum size in megabytes of the log file // before it ges rotated. LogMaxSize int64 // LogMaxAge is the maximum number of days to retain old log files. LogMaxAge int64 // LogMaxBackups is the maximum number of old log files to retain. LogMaxBackups int64 // PublishScript is a path to a script for publishing // the configuration. PublishScript string // CaFile is the cert with the CA for TLS. CaFile string // CertFile is the TLS cert for the server. CertFile string // KeyFile is the key for TLS from the server. KeyFile string // VerifyAndMap verifies the client certificate. VerifyAndMap bool // HTTPUsers are the users that can connect to the server. HTTPUsers []string }
Options for the server.
func ConfigureOptions ¶
func (*Options) ProcessConfigFile ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the NATS ACL Proxy server.
func (*Server) HandleAccounts ¶ added in v0.3.0
func (s *Server) HandleAccounts(w http.ResponseWriter, req *http.Request)
HandleAccounts
func (*Server) HandleGlobalJetStream ¶ added in v0.7.0
func (s *Server) HandleGlobalJetStream(w http.ResponseWriter, req *http.Request)
HandleGlobalJetStream
func (*Server) HandleHealthz ¶
func (s *Server) HandleHealthz(w http.ResponseWriter, req *http.Request)
HandleHealthz handles healthz.
func (*Server) HandleIdent ¶
func (s *Server) HandleIdent(w http.ResponseWriter, req *http.Request)
HandleIdent
func (*Server) HandleIdents ¶
func (s *Server) HandleIdents(w http.ResponseWriter, req *http.Request)
HandleIdents
func (*Server) HandlePerm ¶
func (s *Server) HandlePerm(w http.ResponseWriter, req *http.Request)
HandlePerm handles a request to create/update permissions.
func (*Server) HandlePerms ¶
func (s *Server) HandlePerms(w http.ResponseWriter, req *http.Request)
HandlePerms
func (*Server) HandlePublish ¶
func (s *Server) HandlePublish(w http.ResponseWriter, req *http.Request)
HandlePublish
func (*Server) HandlePublishV2 ¶ added in v0.3.0
func (s *Server) HandlePublishV2(w http.ResponseWriter, req *http.Request)
HandlePublishV2
func (*Server) HandleSnapshot ¶
func (s *Server) HandleSnapshot(w http.ResponseWriter, req *http.Request)
HandleSnapshot
func (*Server) HandleSnapshotV2 ¶ added in v0.3.0
func (s *Server) HandleSnapshotV2(w http.ResponseWriter, req *http.Request)
HandleSnapshotV2
func (*Server) HandleValidateSnapshotV2 ¶ added in v0.3.2
func (s *Server) HandleValidateSnapshotV2(w http.ResponseWriter, req *http.Request)
HandleValidateSnapshotV2
func (*Server) ListenAndServe ¶
ListenAndServe takes the network address and port that the HTTP server should bind to and starts it.
func (*Server) PublishSnapshot ¶ added in v0.5.0
func (*Server) RunDataDirectoryRepair ¶ added in v0.8.0
RunDataDirectoryRepair fixes the data directory in case there are duplicates. This function is meant to be run in a standalone.
func (*Server) SetupSignalHandler ¶
SetupSignalHandler enables handling process signals.
func (*Server) TakeSnapshot ¶ added in v0.5.0
func (*Server) VerifySnapshot ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.