carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

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