Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentIdentifier ¶
type AgentIdentifier interface {
Value() string
}
AgentIdentifier identifies an agent when calling the manifest rendering API
type AgentInfo ¶
type AgentInfo struct { AgentName string `json:"agent_name"` AgentID string `json:"agent_id"` IsNewAgent bool `json:"is_new_agent"` }
AgentInfo contains all data to describe an agent that has been registered in Bcloud.
type Client ¶
type Client interface { RegisterAgent(ctx context.Context, agentName string) (*AgentInfo, error) Credentials(ctx context.Context, agentID string) credentials.PerRPCCredentials GetAgentManifest(ctx context.Context, identifier AgentIdentifier) (string, error) }
type MockAPIServer ¶
MockAPIServer is used to mock the Bcloud client API
func NewMockApiSrv ¶
func NewMockApiSrv(expectedClientID, expectedSecret, expectedAccessToken, expectedName, expectedNewAgentID string) *MockAPIServer
NewMockApiSrv creates a new MockAPIServer.
func (*MockAPIServer) GetError ¶
func (mas *MockAPIServer) GetError() error
GetError returns any error that the server has encountered while processing requests.
func (*MockAPIServer) GetRegistrationRequests ¶
func (mas *MockAPIServer) GetRegistrationRequests() int
GetRegistrationRequests returns the number of agent registration requests that the server has received.
func (*MockAPIServer) GetTokenRequests ¶
func (mas *MockAPIServer) GetTokenRequests() int
GetTokenRequests returns the number of token requests that the server has received.
func (*MockAPIServer) Start ¶
func (mas *MockAPIServer) Start() string
Start starts the mock server and returns its address.
Click to show internal directories.
Click to hide internal directories.