File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
1
package swagger
2
2
3
- import "github.com/cosmos/cosmos-sdk/server/v2/config"
3
+ import (
4
+ "cosmossdk.io/core/server"
5
+ )
6
+
7
+ const ServerName = "swagger"
4
8
5
- // Config represents Swagger configuration options
6
9
type Config struct {
7
- // Enable enables the Swagger UI endpoint
8
- Enable bool `mapstructure:"enable"`
9
- // Path is the URL path where Swagger UI will be served
10
- Path string `mapstructure:"path"`
10
+ Enable bool `toml:"enable" mapstructure:"enable"`
11
+ Address string `toml:"address" mapstructure:"address"`
12
+ Path string `toml:"path" mapstructure:"path"`
11
13
}
12
14
13
- // DefaultConfig returns default configuration for Swagger
14
- func DefaultConfig () Config {
15
- return Config {
16
- Enable : false ,
17
- Path : "/swagger" ,
15
+ func DefaultConfig () * Config {
16
+ return & Config {
17
+ Enable : true ,
18
+ Address : "localhost:8080" ,
19
+ Path : "/swagger/ " ,
18
20
}
19
21
}
20
22
21
- // Validate validates the configuration
22
- func (c Config ) Validate () error {
23
- if c .Path == "" {
24
- return fmt .Errorf ("swagger path cannot be empty" )
25
- }
26
- return nil
27
- }
23
+ type CfgOption func (* Config )
You can’t perform that action at this time.
0 commit comments