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