polycule-connect/polyculeconnect/services/app/app.go
Melora Hugues c91f5f03be
Some checks failed
ci/woodpecker/push/deploy unknown status
ci/woodpecker/push/test Pipeline failed
feat #44: add CLI commands to manage apps
2023-11-08 19:31:34 +01:00

34 lines
761 B
Go

package app
import "github.com/dexidp/dex/storage"
type Service interface {
ListApps() ([]storage.Client, error)
GetApp(id string) (storage.Client, error)
AddApp(config storage.Client) error
RemoveApp(id string) error
}
type concreteAppService struct {
s storage.Storage
}
func (cas *concreteAppService) ListApps() ([]storage.Client, error) {
return cas.s.ListClients()
}
func (cas *concreteAppService) GetApp(id string) (storage.Client, error) {
return cas.s.GetClient(id)
}
func (cas *concreteAppService) AddApp(config storage.Client) error {
return cas.s.CreateClient(config)
}
func (cas *concreteAppService) RemoveApp(id string) error {
return cas.s.DeleteClient(id)
}
func New(s storage.Storage) Service {
return &concreteAppService{s}
}