cabinet_connect_options.go 844 B

1234567891011121314151617181920212223242526
  1. package options
  2. import "github.com/spf13/pflag"
  3. // CabinetConnectOptions 服务运行配置
  4. type CabinetConnectOptions struct {
  5. Port int `json:"port" mapstructure:"port"`
  6. }
  7. func NewCabinetConnectOptions() *CabinetConnectOptions {
  8. return &CabinetConnectOptions{Port: 12091}
  9. }
  10. func (s *CabinetConnectOptions) Validate() []error {
  11. var errors []error
  12. return errors
  13. }
  14. func (s *CabinetConnectOptions) AddFlags(fs *pflag.FlagSet) {
  15. fs.IntVar(&s.Port, "insecure.bind-port", s.Port, ""+
  16. "The port on which to serve unsecured, unauthenticated access. It is assumed "+
  17. "that firewall rules are set up such that this port is not reachable from outside of "+
  18. "the deployed machine and that port 443 on the iam public address is proxied to this "+
  19. "port. This is performed by nginx in the default setup. Set to zero to disable.")
  20. }