mirror of
https://github.com/portainer/portainer.git
synced 2025-08-09 15:55:23 +02:00
add sslsettings
This commit is contained in:
parent
3396f1ca91
commit
357cb66fbf
1 changed files with 10 additions and 1 deletions
|
@ -29,12 +29,21 @@ func NewService(connection portainer.Connection) (*Service, error) {
|
|||
// Settings retrieve the ssl settings object.
|
||||
func (service *Service) Settings() (*portainer.SSLSettings, error) {
|
||||
var settings portainer.SSLSettings
|
||||
db := service.connection.GetDB()
|
||||
tx := db.Take(&settings)
|
||||
if tx.Error != nil {
|
||||
return nil, tx.Error
|
||||
}
|
||||
|
||||
return &settings, nil
|
||||
}
|
||||
|
||||
// UpdateSettings persists a SSLSettings object.
|
||||
func (service *Service) UpdateSettings(settings *portainer.SSLSettings) error {
|
||||
// return service.connection.UpdateObject(BucketName, []byte(key), settings)
|
||||
db := service.connection.GetDB()
|
||||
tx := db.Model(&portainer.SSLSettings{}).Where(portainer.SSLSettings{}).FirstOrCreate(settings)
|
||||
if tx.Error != nil {
|
||||
return tx.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue