MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / mapPocketBaseRecord

Function mapPocketBaseRecord

internal/plugins/communityscripts/scripts.go:245–270  ·  view source on GitHub ↗
(record pocketBaseScriptRecord)

Source from the content-addressed store, hash-verified

243}
244
245func mapPocketBaseRecord(record pocketBaseScriptRecord) Script {
246 sourceType := record.Expand.Type.Type
247 if sourceType == "" {
248 sourceType = record.Type
249 }
250
251 return Script{
252 Name: record.Name,
253 Slug: record.Slug,
254 Description: record.Description,
255 Categories: record.Categories,
256 Type: normalizeScriptType(sourceType),
257 Updateable: record.Updateable,
258 Privileged: record.Privileged,
259 InterfacePort: record.Port,
260 Documentation: record.Documentation,
261 Website: record.Website,
262 ConfigPath: record.ConfigPath,
263 Logo: record.Logo,
264 ScriptPath: buildScriptPath(sourceType, record.Slug),
265 DateCreated: record.Created,
266 IsDev: record.IsDev,
267 IsDisabled: record.IsDisabled,
268 IsDeleted: record.IsDeleted,
269 }
270}
271
272func fetchPocketBase(url string, target any) error {
273 url, err := validateMetadataURL(url)

Callers 2

GetScriptMetadataFunction · 0.70
FetchScriptsFunction · 0.70

Calls 2

normalizeScriptTypeFunction · 0.70
buildScriptPathFunction · 0.70

Tested by

no test coverage detected