@@ -17,7 +17,11 @@ func NewScriptService(repo *repository.ScriptInterpreterRepo) *ScriptService {
|
||||
|
||||
// ResolveCommand builds the full argv[] by prepending the interpreter's argv
|
||||
// to the script text (as the last argument).
|
||||
func (self *ScriptService) ResolveCommand(ctx context.Context, interpreterID int64, scriptText string) ([]string, error) {
|
||||
func (self *ScriptService) ResolveCommand(
|
||||
ctx context.Context,
|
||||
interpreterID int64,
|
||||
scriptText string,
|
||||
) ([]string, error) {
|
||||
interpreter, err := self.repo.GetByID(ctx, interpreterID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -33,11 +37,17 @@ func (self *ScriptService) ResolveCommand(ctx context.Context, interpreterID int
|
||||
return argv, nil
|
||||
}
|
||||
|
||||
func (self *ScriptService) Create(ctx context.Context, in repository.ScriptInterpreterCreate) (*repository.ScriptInterpreter, error) {
|
||||
func (self *ScriptService) Create(
|
||||
ctx context.Context,
|
||||
in repository.ScriptInterpreterCreate,
|
||||
) (*repository.ScriptInterpreter, error) {
|
||||
return self.repo.Create(ctx, in)
|
||||
}
|
||||
|
||||
func (self *ScriptService) GetByID(ctx context.Context, id int64) (*repository.ScriptInterpreter, error) {
|
||||
func (self *ScriptService) GetByID(
|
||||
ctx context.Context,
|
||||
id int64,
|
||||
) (*repository.ScriptInterpreter, error) {
|
||||
return self.repo.GetByID(ctx, id)
|
||||
}
|
||||
|
||||
@@ -45,7 +55,11 @@ func (self *ScriptService) List(ctx context.Context) ([]repository.ScriptInterpr
|
||||
return self.repo.List(ctx)
|
||||
}
|
||||
|
||||
func (self *ScriptService) Update(ctx context.Context, id int64, in repository.ScriptInterpreterUpdate) (*repository.ScriptInterpreter, error) {
|
||||
func (self *ScriptService) Update(
|
||||
ctx context.Context,
|
||||
id int64,
|
||||
in repository.ScriptInterpreterUpdate,
|
||||
) (*repository.ScriptInterpreter, error) {
|
||||
return self.repo.Update(ctx, id, in)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user