implement exec SetURI
This commit is contained in:
parent
99849a489b
commit
052c496c35
@ -10,6 +10,7 @@ import (
|
||||
"net/url"
|
||||
_ "os"
|
||||
_ "os/exec"
|
||||
"path/filepath"
|
||||
_ "strings"
|
||||
)
|
||||
|
||||
@ -41,7 +42,13 @@ func (x *Exec) URI() string {
|
||||
}
|
||||
|
||||
func (x *Exec) SetURI(uri string) error {
|
||||
return nil
|
||||
resourceUri, e := url.Parse(uri)
|
||||
if resourceUri.Scheme == "exec" {
|
||||
x.Id = filepath.Join(resourceUri.Hostname(), resourceUri.RequestURI())
|
||||
} else {
|
||||
e = fmt.Errorf("%w: %s is not an exec resource ", ErrInvalidResourceURI, uri)
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
func (x *Exec) ResolveId(ctx context.Context) string {
|
||||
|
Loading…
Reference in New Issue
Block a user