MCPcopy Index your code
hub / github.com/cortexlabs/cortex / SplitS3Path

Function SplitS3Path

pkg/lib/aws/s3.go:75–88  ·  view source on GitHub ↗
(s3Path string)

Source from the content-addressed store, hash-verified

73}
74
75func SplitS3Path(s3Path string) (string, string, error) {
76 if !IsValidS3Path(s3Path) {
77 return "", "", ErrorInvalidS3Path(s3Path)
78 }
79 fullPath := s3Path[len("s3://"):]
80 slashIndex := strings.Index(fullPath, "/")
81 if slashIndex == -1 {
82 return fullPath, "", nil
83 }
84 bucket := fullPath[0:slashIndex]
85 key := fullPath[slashIndex+1:]
86
87 return bucket, key, nil
88}
89
90func SplitS3aPath(s3aPath string) (string, string, error) {
91 if !IsValidS3aPath(s3aPath) {

Callers 11

s3IteratorFromListerFunction · 0.92
NewFromS3PathFunction · 0.85
IsS3PathFileMethod · 0.85
IsS3PathPrefixMethod · 0.85
IsS3PathDirMethod · 0.85
ReadStringFromS3PathMethod · 0.85
ReadBytesFromS3PathMethod · 0.85
ReadMsgpackFromS3PathMethod · 0.85
ListS3PathPrefixMethod · 0.85

Calls 3

IndexFunction · 0.92
IsValidS3PathFunction · 0.85
ErrorInvalidS3PathFunction · 0.85

Tested by

no test coverage detected