Support Index cli (#2)

* Add sbom support from index-cli

* Drop error channel

* return value is treated as an Invoke Op

* Add the index-cli-plugin

* Fix sample again

* Build platforms in multi-arch Docker build

* change go.sh for /bin/sh env in alpine

* Add workflow
This commit is contained in:
Jim Clark
2023-01-17 20:28:17 -08:00
committed by GitHub
parent b2d8fdbbd5
commit 5df70f8d7f
16 changed files with 2552 additions and 17 deletions

View File

@@ -71,6 +71,20 @@ func WriteInvokeResponse(inputMessage *Message, value any) error {
return nil
}
func WriteNotDoneInvokeResponse(inputMessage *Message, value any) error {
if value == nil {
return nil
}
resultValue, err := json.Marshal(value)
if err != nil {
return err
}
response := InvokeResponse{Id: inputMessage.Id, Status: []string{}, Value: string(resultValue)}
writeResponse(response)
return nil
}
func WriteErrorResponse(inputMessage *Message, err error) {
errorResponse := ErrorResponse{Id: inputMessage.Id, Status: []string{"done", "error"}, ExMessage: err.Error()}
writeResponse(errorResponse)