(ctx context.Context, appName string, enable bool)
| 31 | } |
| 32 | |
| 33 | func StickySession(ctx context.Context, appName string, enable bool) error { |
| 34 | c, err := config.ScalingoClient(ctx) |
| 35 | if err != nil { |
| 36 | return errors.Wrapf(ctx, err, "fail to get Scalingo client") |
| 37 | } |
| 38 | _, err = c.AppsStickySession(ctx, appName, enable) |
| 39 | if err != nil { |
| 40 | return errors.Wrapf(ctx, err, "fail to configure sticky-session feature") |
| 41 | } |
| 42 | |
| 43 | var action string |
| 44 | if enable { |
| 45 | action = "enable" |
| 46 | } else { |
| 47 | action = "disable" |
| 48 | } |
| 49 | |
| 50 | io.Statusf("Sticky session has been %sd on %s\n", action, appName) |
| 51 | return nil |
| 52 | } |
| 53 | |
| 54 | func RouterLogs(ctx context.Context, appName string, enable bool) error { |
| 55 | c, err := config.ScalingoClient(ctx) |
no test coverage detected