Download this file
| 1 | package host |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "errors" |
| 6 | "github.com/carlosframework/platform/internal/activator" |
| 7 | "github.com/carlosframework/platform/internal/hostbox" |
| 8 | ) |
| 9 | |
| 10 | type fakeLaunchRoot struct { |
| 11 | protocol string |
| 12 | err error |
| 13 | } |
| 14 | |
| 15 | func (f fakeLaunchRoot) Capability(context.Context) (string, error) { return f.protocol, f.err } |
| 16 | func (fakeLaunchRoot) Launch(context.Context, hostbox.RoleLaunchRequest) (hostbox.RoleLaunchGrant, error) { |
| 17 | return hostbox.RoleLaunchGrant{}, errors.New("unused") |
| 18 | } |
| 19 | func (fakeLaunchRoot) Stop(context.Context, hostbox.RoleLaunchRequest) error { return nil } |
| 20 | |
| 21 | func (f fakeLaunchRoot) KindCapability(context.Context, string) error { |
| 22 | if f.protocol != hostbox.RoleLaunchProtocol { |
| 23 | return activator.ErrClaimIsolationUnavailable |
| 24 | } |
| 25 | return f.err |
| 26 | } |
| 27 | |