-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
535 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package bucket | ||
|
||
func (cp *CachedPlugin) GetName() string { | ||
if cp.RemotePlugin != nil { | ||
return cp.RemotePlugin.GetName() | ||
} | ||
|
||
return cp.name | ||
} | ||
|
||
func (cp *CachedPlugin) GetIdentifier() string { | ||
if cp.RemotePlugin != nil { | ||
return cp.RemotePlugin.GetIdentifier() | ||
} | ||
|
||
return cp.RemoteIdentifier | ||
} | ||
|
||
func (cp *CachedPlugin) GetAuthors() []string { | ||
if cp.RemotePlugin != nil { | ||
return cp.RemotePlugin.GetAuthors() | ||
} | ||
|
||
return cp.authors | ||
} | ||
|
||
func (cp *CachedPlugin) GetDescription() string { | ||
if cp.RemotePlugin != nil { | ||
return cp.RemotePlugin.GetDescription() | ||
} | ||
|
||
return cp.description | ||
} | ||
|
||
func (cp *CachedPlugin) GetWebsite() string { | ||
if cp.RemotePlugin != nil { | ||
return cp.RemotePlugin.GetWebsite() | ||
} | ||
|
||
return cp.website | ||
} | ||
|
||
func (cp *CachedPlugin) requestIfMissing() error { | ||
if cp.RemotePlugin == nil { | ||
return cp.Request() | ||
} else { | ||
return nil | ||
} | ||
} | ||
|
||
func (cp *CachedPlugin) GetLatestVersion() (RemoteVersion, error) { | ||
if err := cp.requestIfMissing(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return cp.RemotePlugin.GetLatestVersion() | ||
} | ||
|
||
func (cp *CachedPlugin) GetVersions() ([]RemoteVersion, error) { | ||
if err := cp.requestIfMissing(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return cp.RemotePlugin.GetVersions() | ||
} | ||
|
||
func (cp *CachedPlugin) GetVersion(version string) (RemoteVersion, error) { | ||
if err := cp.requestIfMissing(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return cp.RemotePlugin.GetVersion(version) | ||
} | ||
|
||
func (cp *CachedPlugin) GetVersionIdentifiers() ([]string, error) { | ||
if err := cp.requestIfMissing(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return cp.RemotePlugin.GetVersionIdentifiers() | ||
} | ||
|
||
func (cp *CachedPlugin) GetLatestCompatible(plt PlatformType) (RemoteVersion, error) { | ||
if err := cp.requestIfMissing(); err != nil { | ||
return nil, err | ||
} | ||
|
||
return cp.RemotePlugin.GetLatestCompatible(plt) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.