This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
minifaas/engine/docker/name.go

19 lines
305 B
Go
Raw Normal View History

2021-05-08 22:55:45 +00:00
package docker
import (
"crypto/rand"
"fmt"
"github.com/nemunaire/minifaas/engine"
)
2021-05-09 16:02:23 +00:00
func genContainerName(jobtype string) string {
2021-05-08 22:55:45 +00:00
uuid := make([]byte, 24)
_, err := rand.Read(uuid)
if err != nil {
panic(err.Error())
}
2021-05-09 16:02:23 +00:00
return fmt.Sprintf("%s%x", engine.GenContainerPrefix(jobtype), uuid)
2021-05-08 22:55:45 +00:00
}