GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cli/logs.go at master · carimura/cli Expand file tree/ Copy pathlogs.goMore file actions 53 lines (47 loc) · 1.17 KB / Copy pathlogs.goFile metadata and controls53 lines (47 loc) · 1.17 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 package main import ( "context" "fmt" client "github.com/fnproject/cli/client" fnclient "github.com/funcy/functions_go/client" apicall "github.com/funcy/functions_go/client/operations" "github.com/urfave/cli" ) type logsCmd struct { client *fnclient.Functions } func logs() cli.Command { c := logsCmd{client: client.APIClient()} return cli.Command{ Name: "logs", Usage: "manage function calls for apps", Subcommands: []cli.Command{ { Name: "get", Aliases: []string{"g"}, Usage: "get function call log info per app", ArgsUsage: "<app> <call-id>", Action: c.get, }, }, } } func (log *logsCmd) get(ctx *cli.Context) error { app, callID := ctx.Args().Get(0), ctx.Args().Get(1) params := apicall.GetAppsAppCallsCallLogParams{ Call: callID, App: app, Context: context.Background(), } resp, err := log.client.Operations.GetAppsAppCallsCallLog(¶ms) if err != nil { switch e := err.(type) { case *apicall.GetAppsAppCallsCallLogNotFound: return fmt.Errorf("error: %v", e.Payload.Error.Message) default: return fmt.Errorf("unexpected error: %v", err) } } fmt.Print(resp.Payload.Log.Log) return nil } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |