@@ -75,7 +75,7 @@ type Config struct {
75
75
SkipValidation bool `json:"-"`
76
76
77
77
// Keeps record of the filename the Config is read from
78
- loadedFromFilename string
78
+ loadedFromFilepath string
79
79
}
80
80
81
81
// ASN1DN contains ASN1.DN attributes that are used in Subject and Issuer
@@ -167,7 +167,7 @@ func LoadConfiguration(filename string) (*Config, error) {
167
167
}
168
168
169
169
// store filename that was read to populate Config
170
- c .loadedFromFilename = filename
170
+ c .loadedFromFilepath = filename
171
171
172
172
// initialize the Config
173
173
c .Init ()
@@ -215,13 +215,19 @@ func (c *Config) Commit() error {
215
215
if ! c .WasLoadedFromFile () {
216
216
return errors .New ("cannot commit configuration if not loaded from file" )
217
217
}
218
- return c .Save (c .loadedFromFilename )
218
+ return c .Save (c .loadedFromFilepath )
219
219
}
220
220
221
221
// WasLoadedFromFile returns whether or not the Config was
222
- // read from a file.
222
+ // loaded from a file.
223
223
func (c * Config ) WasLoadedFromFile () bool {
224
- return c .loadedFromFilename != ""
224
+ return c .loadedFromFilepath != ""
225
+ }
226
+
227
+ // Filepath returns the path to the file the Config was
228
+ // loaded from.
229
+ func (c * Config ) Filepath () string {
230
+ return c .loadedFromFilepath
225
231
}
226
232
227
233
// Validate validates the configuration.
0 commit comments