Documentation
¶
Overview ¶
Copyright 2025 Cloudbase Solutions SRL
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 2025 Cloudbase Solutions SRL
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 2025 Cloudbase Solutions SRL
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 2025 Cloudbase Solutions SRL
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 2025 Cloudbase Solutions SRL
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 2026 Cloudbase Solutions SRL
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 2025 Cloudbase Solutions SRL
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 2025 Cloudbase Solutions SRL
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 ¶
- func ControllerInfo() params.ControllerInfo
- func DeleteEntity(entityID string)
- func DeleteEntityPool(entityID string, poolID string)
- func DeleteEntityScaleSet(entityID string, scaleSetID uint)
- func DeleteGiteaCredentials(id uint)
- func DeleteGithubClient(entityID string)
- func DeleteGithubCredentials(id uint)
- func DeleteGithubToolsCache(entityID string)
- func DeleteInstanceCache(name string)
- func DeleteProxy(id uint)
- func DeleteTemplate(id uint)
- func EntityRateLimitExhausted(entityID string) (bool, time.Time)
- func EntityRateLimitReached(entityID string) (bool, time.Time)
- func FindPoolsMatchingAllTags(entityID string, tags []string) []params.Pool
- func GetAllEntities() []params.ForgeEntity
- func GetAllGiteaCredentials() []params.ForgeCredentials
- func GetAllGiteaCredentialsAsMap() map[uint]params.ForgeCredentials
- func GetAllGithubCredentials() []params.ForgeCredentials
- func GetAllGithubCredentialsAsMap() map[uint]params.ForgeCredentials
- func GetAllInstancesCache() []params.Instance
- func GetAllPools() []params.Pool
- func GetAllScaleSets() []params.ScaleSet
- func GetEndpoint(epName string) (params.ForgeEndpoint, bool)
- func GetEntitiesUsingCredentials(creds params.ForgeCredentials) []params.ForgeEntity
- func GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity
- func GetEntity(entityID string) (params.ForgeEntity, bool)
- func GetEntityForInstance(name string) (params.ForgeEntity, bool)
- func GetEntityForPool(poolID string) (params.ForgeEntity, bool)
- func GetEntityForScaleSet(scaleSetID uint) (params.ForgeEntity, bool)
- func GetEntityInstances(entityID string) []params.Instance
- func GetEntityPool(entityID string, poolID string) (params.Pool, bool)
- func GetEntityPools(entityID string) []params.Pool
- func GetEntityRunnerGroup(entityID, runnerGroupName string) (int64, bool)
- func GetEntityScaleSet(entityID string, scaleSetID uint) (params.ScaleSet, bool)
- func GetEntityScaleSets(entityID string) []params.ScaleSet
- func GetForgeCredentials(forgeType params.EndpointType, id uint) (params.ForgeCredentials, bool)
- func GetGiteaCredentials(id uint) (params.ForgeCredentials, bool)
- func GetGithubClient(entityID string) (common.GithubClient, bool)
- func GetGithubCredentials(id uint) (params.ForgeCredentials, bool)
- func GetGithubToolsCache(entityID string) ([]commonParams.RunnerApplicationDownload, error)
- func GetInstanceCache(name string) (params.Instance, bool)
- func GetInstancesForPool(poolID string) []params.Instance
- func GetInstancesForScaleSet(scaleSetID uint) []params.Instance
- func GetPoolByID(poolID string) (params.Pool, bool)
- func GetProxy(id uint) (params.Proxy, bool)
- func GetScaleSetByID(scaleSetID uint) (params.ScaleSet, bool)
- func GetTemplate(id uint) (params.Template, bool)
- func ListProxies() []params.Proxy
- func ListTemplates(osType *commonParams.OSType, forgeType *params.EndpointType) []params.Template
- func RemoveEndpoint(epName string)
- func ReplaceEntityPools(entityID string, pools []params.Pool)
- func ReplaceEntityScaleSets(entityID string, scaleSets []params.ScaleSet)
- func SetControllerCache(ctrl params.ControllerInfo)
- func SetCredentialsRateLimit(credsID uint, rateLimit params.GithubRateLimit)
- func SetEndpoint(ep params.ForgeEndpoint)
- func SetEntity(entity params.ForgeEntity)
- func SetEntityPool(entityID string, pool params.Pool)
- func SetEntityRunnerGroup(entityID, runnerGroupName string, runnerGroupID int64)
- func SetEntityScaleSet(entityID string, scaleSet params.ScaleSet)
- func SetGiteaCredentials(credentials params.ForgeCredentials)
- func SetGithubClient(entityID string, client common.GithubClient)
- func SetGithubCredentials(credentials params.ForgeCredentials)
- func SetGithubToolsCache(entity params.ForgeEntity, tools []commonParams.RunnerApplicationDownload)
- func SetInstanceCache(instance params.Instance)
- func SetProxyCache(proxy params.Proxy)
- func SetTemplateCache(tpl params.Template)
- func UpdateCredentialsInAffectedEntities(creds params.ForgeCredentials)
- func UpdateCredentialsUsingEndpoint(ep params.ForgeEndpoint)
- type ControllerCache
- type EntityCache
- func (e *EntityCache) DeleteEntity(entityID string)
- func (e *EntityCache) DeleteEntityPool(entityID string, poolID string)
- func (e *EntityCache) DeleteEntityScaleSet(entityID string, scaleSetID uint)
- func (e *EntityCache) FindPoolsMatchingAllTags(entityID string, tags []string) []params.Pool
- func (e *EntityCache) GetAllEntities() []params.ForgeEntity
- func (e *EntityCache) GetAllPools() []params.Pool
- func (e *EntityCache) GetAllScaleSets() []params.ScaleSet
- func (e *EntityCache) GetEntitiesUsingCredentials(creds params.ForgeCredentials) []params.ForgeEntity
- func (e *EntityCache) GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity
- func (e *EntityCache) GetEntity(entityID string) (params.ForgeEntity, bool)
- func (e *EntityCache) GetEntityForPool(poolID string) (params.ForgeEntity, bool)
- func (e *EntityCache) GetEntityForScaleSet(scaleSetID uint) (params.ForgeEntity, bool)
- func (e *EntityCache) GetEntityPool(entityID string, poolID string) (params.Pool, bool)
- func (e *EntityCache) GetEntityPools(entityID string) []params.Pool
- func (e *EntityCache) GetEntityRunnerGroup(entityID, runnerGroupName string) (int64, bool)
- func (e *EntityCache) GetEntityScaleSet(entityID string, scaleSetID uint) (params.ScaleSet, bool)
- func (e *EntityCache) GetEntityScaleSets(entityID string) []params.ScaleSet
- func (e *EntityCache) GetPoolByID(poolID string) (params.Pool, bool)
- func (e *EntityCache) GetScaleSetByID(scaleSetID uint) (params.ScaleSet, bool)
- func (e *EntityCache) ReplaceEntityPools(entityID string, pools []params.Pool)
- func (e *EntityCache) ReplaceEntityScaleSets(entityID string, scaleSets []params.ScaleSet)
- func (e *EntityCache) SetEntity(entity params.ForgeEntity)
- func (e *EntityCache) SetEntityPool(entityID string, pool params.Pool)
- func (e *EntityCache) SetEntityRunnerGroup(entityID, runnerGroupName string, runnerGroupID int64)
- func (e *EntityCache) SetEntityScaleSet(entityID string, scaleSet params.ScaleSet)
- func (e *EntityCache) UpdateCredentialsInAffectedEntities(creds params.ForgeCredentials)
- type EntityItem
- type GithubClientCache
- type GithubEntityTools
- type GithubToolsCache
- type RunnerGroupEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControllerInfo ¶
func ControllerInfo() params.ControllerInfo
func DeleteEntity ¶
func DeleteEntity(entityID string)
func DeleteEntityPool ¶
func DeleteEntityScaleSet ¶
func DeleteGiteaCredentials ¶
func DeleteGiteaCredentials(id uint)
func DeleteGithubClient ¶
func DeleteGithubClient(entityID string)
func DeleteGithubCredentials ¶
func DeleteGithubCredentials(id uint)
func DeleteGithubToolsCache ¶
func DeleteGithubToolsCache(entityID string)
func DeleteInstanceCache ¶
func DeleteInstanceCache(name string)
func DeleteProxy ¶ added in v0.2.2
func DeleteProxy(id uint)
func DeleteTemplate ¶
func DeleteTemplate(id uint)
func EntityRateLimitExhausted ¶ added in v0.2.2
EntityRateLimitExhausted reports whether the quota of the credentials currently assigned to the given entity is fully spent, meaning even critical operations cannot succeed, and when it resets. Entities or credentials missing from the cache are never limited.
func EntityRateLimitReached ¶ added in v0.2.2
EntityRateLimitReached reports whether the credentials currently assigned to the given entity should be considered rate limited for normal (non-critical) operations, and when the quota resets. Entities or credentials missing from the cache are never limited.
func GetAllEntities ¶
func GetAllEntities() []params.ForgeEntity
func GetAllGiteaCredentials ¶
func GetAllGiteaCredentials() []params.ForgeCredentials
func GetAllGiteaCredentialsAsMap ¶
func GetAllGiteaCredentialsAsMap() map[uint]params.ForgeCredentials
func GetAllGithubCredentials ¶
func GetAllGithubCredentials() []params.ForgeCredentials
func GetAllGithubCredentialsAsMap ¶
func GetAllGithubCredentialsAsMap() map[uint]params.ForgeCredentials
func GetAllInstancesCache ¶
func GetAllPools ¶
func GetAllScaleSets ¶
func GetEndpoint ¶
func GetEndpoint(epName string) (params.ForgeEndpoint, bool)
func GetEntitiesUsingCredentials ¶
func GetEntitiesUsingCredentials(creds params.ForgeCredentials) []params.ForgeEntity
func GetEntitiesUsingEndpoint ¶
func GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity
func GetEntityForInstance ¶
func GetEntityForInstance(name string) (params.ForgeEntity, bool)
func GetEntityForPool ¶
func GetEntityForPool(poolID string) (params.ForgeEntity, bool)
func GetEntityForScaleSet ¶
func GetEntityForScaleSet(scaleSetID uint) (params.ForgeEntity, bool)
func GetEntityInstances ¶
func GetEntityPools ¶
func GetEntityRunnerGroup ¶
func GetEntityScaleSet ¶
func GetEntityScaleSets ¶
func GetForgeCredentials ¶ added in v0.2.2
func GetForgeCredentials(forgeType params.EndpointType, id uint) (params.ForgeCredentials, bool)
GetForgeCredentials returns the cached credentials with the given ID for the specified forge type. Unlike the copies workers hold on their entities, the cached credentials carry the most recently observed rate limit values.
func GetGiteaCredentials ¶
func GetGiteaCredentials(id uint) (params.ForgeCredentials, bool)
func GetGithubClient ¶
func GetGithubClient(entityID string) (common.GithubClient, bool)
func GetGithubCredentials ¶
func GetGithubCredentials(id uint) (params.ForgeCredentials, bool)
func GetGithubToolsCache ¶
func GetGithubToolsCache(entityID string) ([]commonParams.RunnerApplicationDownload, error)
func GetInstancesForPool ¶
func GetInstancesForScaleSet ¶
func ListProxies ¶ added in v0.2.2
func ListTemplates ¶
func ListTemplates(osType *commonParams.OSType, forgeType *params.EndpointType) []params.Template
func RemoveEndpoint ¶
func RemoveEndpoint(epName string)
func ReplaceEntityPools ¶
func ReplaceEntityScaleSets ¶
func SetControllerCache ¶
func SetControllerCache(ctrl params.ControllerInfo)
func SetCredentialsRateLimit ¶
func SetCredentialsRateLimit(credsID uint, rateLimit params.GithubRateLimit)
func SetEndpoint ¶
func SetEndpoint(ep params.ForgeEndpoint)
func SetEntity ¶
func SetEntity(entity params.ForgeEntity)
func SetEntityPool ¶
func SetEntityRunnerGroup ¶
func SetEntityScaleSet ¶
func SetGiteaCredentials ¶
func SetGiteaCredentials(credentials params.ForgeCredentials)
func SetGithubClient ¶
func SetGithubClient(entityID string, client common.GithubClient)
func SetGithubCredentials ¶
func SetGithubCredentials(credentials params.ForgeCredentials)
func SetGithubToolsCache ¶
func SetGithubToolsCache(entity params.ForgeEntity, tools []commonParams.RunnerApplicationDownload)
func SetInstanceCache ¶
func SetProxyCache ¶ added in v0.2.2
func SetTemplateCache ¶
func UpdateCredentialsInAffectedEntities ¶
func UpdateCredentialsInAffectedEntities(creds params.ForgeCredentials)
func UpdateCredentialsUsingEndpoint ¶
func UpdateCredentialsUsingEndpoint(ep params.ForgeEndpoint)
UpdateCredentialsUsingEndpoint refreshes the endpoint embedded in every cached credential that belongs to it. Endpoint names are unique across forge types, so a name matches credentials in at most one of the caches.
Types ¶
type ControllerCache ¶
type ControllerCache struct {
// contains filtered or unexported fields
}
func (*ControllerCache) ControllerInfo ¶
func (c *ControllerCache) ControllerInfo() params.ControllerInfo
func (*ControllerCache) SetControllerCache ¶
func (c *ControllerCache) SetControllerCache(ctrl params.ControllerInfo)
type EntityCache ¶
type EntityCache struct {
// contains filtered or unexported fields
}
func (*EntityCache) DeleteEntity ¶
func (e *EntityCache) DeleteEntity(entityID string)
func (*EntityCache) DeleteEntityPool ¶
func (e *EntityCache) DeleteEntityPool(entityID string, poolID string)
func (*EntityCache) DeleteEntityScaleSet ¶
func (e *EntityCache) DeleteEntityScaleSet(entityID string, scaleSetID uint)
func (*EntityCache) FindPoolsMatchingAllTags ¶
func (e *EntityCache) FindPoolsMatchingAllTags(entityID string, tags []string) []params.Pool
func (*EntityCache) GetAllEntities ¶
func (e *EntityCache) GetAllEntities() []params.ForgeEntity
func (*EntityCache) GetAllPools ¶
func (e *EntityCache) GetAllPools() []params.Pool
func (*EntityCache) GetAllScaleSets ¶
func (e *EntityCache) GetAllScaleSets() []params.ScaleSet
func (*EntityCache) GetEntitiesUsingCredentials ¶
func (e *EntityCache) GetEntitiesUsingCredentials(creds params.ForgeCredentials) []params.ForgeEntity
func (*EntityCache) GetEntitiesUsingEndpoint ¶
func (e *EntityCache) GetEntitiesUsingEndpoint(endpoint params.ForgeEndpoint) []params.ForgeEntity
func (*EntityCache) GetEntity ¶
func (e *EntityCache) GetEntity(entityID string) (params.ForgeEntity, bool)
func (*EntityCache) GetEntityForPool ¶
func (e *EntityCache) GetEntityForPool(poolID string) (params.ForgeEntity, bool)
func (*EntityCache) GetEntityForScaleSet ¶
func (e *EntityCache) GetEntityForScaleSet(scaleSetID uint) (params.ForgeEntity, bool)
func (*EntityCache) GetEntityPool ¶
func (*EntityCache) GetEntityPools ¶
func (e *EntityCache) GetEntityPools(entityID string) []params.Pool
func (*EntityCache) GetEntityRunnerGroup ¶
func (e *EntityCache) GetEntityRunnerGroup(entityID, runnerGroupName string) (int64, bool)
func (*EntityCache) GetEntityScaleSet ¶
func (*EntityCache) GetEntityScaleSets ¶
func (e *EntityCache) GetEntityScaleSets(entityID string) []params.ScaleSet
func (*EntityCache) GetPoolByID ¶
func (e *EntityCache) GetPoolByID(poolID string) (params.Pool, bool)
func (*EntityCache) GetScaleSetByID ¶
func (e *EntityCache) GetScaleSetByID(scaleSetID uint) (params.ScaleSet, bool)
func (*EntityCache) ReplaceEntityPools ¶
func (e *EntityCache) ReplaceEntityPools(entityID string, pools []params.Pool)
func (*EntityCache) ReplaceEntityScaleSets ¶
func (e *EntityCache) ReplaceEntityScaleSets(entityID string, scaleSets []params.ScaleSet)
func (*EntityCache) SetEntity ¶
func (e *EntityCache) SetEntity(entity params.ForgeEntity)
func (*EntityCache) SetEntityPool ¶
func (e *EntityCache) SetEntityPool(entityID string, pool params.Pool)
func (*EntityCache) SetEntityRunnerGroup ¶
func (e *EntityCache) SetEntityRunnerGroup(entityID, runnerGroupName string, runnerGroupID int64)
func (*EntityCache) SetEntityScaleSet ¶
func (e *EntityCache) SetEntityScaleSet(entityID string, scaleSet params.ScaleSet)
func (*EntityCache) UpdateCredentialsInAffectedEntities ¶
func (e *EntityCache) UpdateCredentialsInAffectedEntities(creds params.ForgeCredentials)
type EntityItem ¶
type EntityItem struct {
Entity params.ForgeEntity
Pools map[string]struct{}
ScaleSets map[uint]struct{}
RunnerGroups map[string]RunnerGroupEntry
}
type GithubClientCache ¶
type GithubClientCache struct {
// contains filtered or unexported fields
}
func (*GithubClientCache) DeleteClient ¶
func (g *GithubClientCache) DeleteClient(entityID string)
func (*GithubClientCache) GetClient ¶
func (g *GithubClientCache) GetClient(entityID string) (common.GithubClient, bool)
func (*GithubClientCache) SetClient ¶
func (g *GithubClientCache) SetClient(entityID string, client common.GithubClient)
type GithubEntityTools ¶
type GithubEntityTools struct {
// contains filtered or unexported fields
}
type GithubToolsCache ¶
type GithubToolsCache struct {
// contains filtered or unexported fields
}
func (*GithubToolsCache) Delete ¶
func (g *GithubToolsCache) Delete(entityID string)
func (*GithubToolsCache) Get ¶
func (g *GithubToolsCache) Get(entityID string) ([]commonParams.RunnerApplicationDownload, error)
func (*GithubToolsCache) Set ¶
func (g *GithubToolsCache) Set(entity params.ForgeEntity, tools []commonParams.RunnerApplicationDownload)
type RunnerGroupEntry ¶
type RunnerGroupEntry struct {
RunnerGroupID int64
// contains filtered or unexported fields
}