Documentation ¶
Overview ¶
Copyright © 2023 Harry C <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2023 Harry C <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( PathJoin = "/v1/agent/join" PathAccept = "/v1/agent/accept" PathSubmit = "/v1/agent/submit" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionInfo ¶ added in v1.1.0
type HubServer ¶
type HubServer struct {
// contains filtered or unexported fields
}
Hub server is responsible for: 1. Manage agents' connections 2. Forward applications' request to the right agent
func NewHubServer ¶
func NewHubServer(secret string, opts ...HubServerOption) *HubServer
func (*HubServer) GetConnectionsInfos ¶ added in v1.1.0
func (hs *HubServer) GetConnectionsInfos() []*ConnectionInfo
type HubServerOption ¶
type HubServerOption func(hs *HubServer)
func WithAppPassword ¶ added in v1.1.1
func WithAppPassword(password string) HubServerOption
func WithCatalog ¶ added in v1.1.7
func WithCatalog(c Catalog) HubServerOption
func WithConcurrent ¶
func WithConcurrent(n int) HubServerOption
type MemoryCatalog ¶ added in v1.1.7
type MemoryCatalog struct {
// contains filtered or unexported fields
}
func NewMemoryCatalog ¶ added in v1.1.7
func NewMemoryCatalog() *MemoryCatalog
func (*MemoryCatalog) GetHardwareInfo ¶ added in v1.1.7
func (mc *MemoryCatalog) GetHardwareInfo(agentID int) *hwinfo.HWInfo
func (*MemoryCatalog) SetHardwareInfo ¶ added in v1.1.7
func (mc *MemoryCatalog) SetHardwareInfo(agentID int, hwInfo *hwinfo.HWInfo)
type TokenManager ¶
type TokenManager interface { Encrypt(*token.AgentToken) (string, error) Decrypt(string) (*token.AgentToken, error) }