-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
9 changed files
with
168 additions
and
2 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
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
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,11 @@ | ||
package fleek | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/mrusme/planor/nori/models" | ||
) | ||
|
||
func (cloud *Fleek) ListPipelines() ([]models.Pipeline, error) { | ||
return nil, errors.New("Unsupported") | ||
} |
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,43 @@ | ||
package fleek | ||
|
||
import ( | ||
// "context" | ||
"os" | ||
|
||
"github.com/mrusme/planor/nori/adapter" | ||
|
||
gofleek "github.com/mrusme/go-fleek" | ||
) | ||
|
||
type Fleek struct { | ||
apiKey string | ||
teamId string | ||
fleek *gofleek.FleekClient | ||
} | ||
|
||
func (cloud *Fleek) LoadProfile(profile *string) (error) { | ||
cloud.apiKey = os.Getenv(*profile) | ||
cloud.teamId = os.Getenv("FLEEK_TEAM_ID") | ||
|
||
return nil | ||
} | ||
|
||
func (cloud *Fleek) LoadClients() (error) { | ||
var err error | ||
cloud.fleek, err = gofleek.New(cloud.apiKey) | ||
|
||
return err | ||
} | ||
|
||
func (cloud *Fleek) GetCapabilities() ([]adapter.Capability) { | ||
var caps []adapter.Capability | ||
|
||
caps = append(caps, adapter.Capability{ | ||
ID: "instances", | ||
Name: "Sites", | ||
}) | ||
|
||
return caps | ||
} | ||
|
||
|
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,31 @@ | ||
package fleek | ||
|
||
import ( | ||
"github.com/mrusme/planor/nori/models" | ||
|
||
// gofleek "github.com/mrusme/go-fleek" | ||
) | ||
|
||
func (cloud *Fleek) ListInstances() ([]models.Instance, error) { | ||
var instances []models.Instance | ||
ret, err := cloud.fleek.GetSitesByTeamId(cloud.teamId) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, instance := range ret { | ||
newInstance := models.Instance{ | ||
ID: instance.Slug, | ||
Name: instance.Name, | ||
|
||
Type: instance.Platform, | ||
|
||
Status: instance.PublishedDeploy.Status, | ||
} | ||
|
||
instances = append(instances, newInstance) | ||
} | ||
|
||
return instances, nil | ||
} | ||
|
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,21 @@ | ||
package fleek | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/mrusme/planor/nori/models" | ||
) | ||
|
||
|
||
func (cloud *Fleek) ListLogGroups(updateStreams bool, updateEvents bool) ([]models.LogGroup, error) { | ||
return nil, errors.New("Unsupported") | ||
} | ||
|
||
func (cloud *Fleek) UpdateLogStreams(logGroup *models.LogGroup, updateEvents bool) (error) { | ||
return errors.New("Unsupported") | ||
} | ||
|
||
func (cloud *Fleek) UpdateLogEvents(logStream *models.LogStream) (error) { | ||
return errors.New("Unsupported") | ||
} | ||
|
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