github.com/davidmanzanares/dsd@v0.1.2-0.20210106152357-a35988f5d245/dsdl/service.go (about) 1 package dsdl 2 3 import ( 4 "errors" 5 "fmt" 6 "strings" 7 8 "github.com/davidmanzanares/dsd/provider/s3" 9 "github.com/davidmanzanares/dsd/types" 10 ) 11 12 func getProviderFromService(service string) (types.Provider, error) { 13 if strings.HasPrefix(service, "s3:") { 14 return s3.Create(service) 15 } 16 return nil, errors.New(fmt.Sprint("Unkown service:", service)) 17 }