mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
This commit is contained in:
parent
e2979a631a
commit
6cfffb38f9
4 changed files with 44 additions and 10 deletions
|
@ -1,6 +1,8 @@
|
|||
package file
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/portainer/portainer"
|
||||
|
||||
"io"
|
||||
|
@ -162,3 +164,13 @@ func (service *Service) createFileInStore(filePath string, r io.Reader) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetStringFromFile returns a string content from file.
|
||||
func GetStringFromFile(filePath string) (string, error) {
|
||||
content, err := ioutil.ReadFile(filePath)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(content), nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue