2018-09-12 19:24:17 +00:00
|
|
|
package platform
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
// OnboardingResults is a group of elements required for first run.
|
|
|
|
type OnboardingResults struct {
|
|
|
|
User *User `json:"user"`
|
|
|
|
Org *Organization `json:"org"`
|
|
|
|
Bucket *Bucket `json:"bucket"`
|
|
|
|
Auth *Authorization `json:"auth"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OnboardingRequest is the request
|
|
|
|
// to setup defaults.
|
|
|
|
type OnboardingRequest struct {
|
2018-10-18 19:09:25 +00:00
|
|
|
User string `json:"username"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Org string `json:"org"`
|
|
|
|
Bucket string `json:"bucket"`
|
|
|
|
RetentionPeriod uint `json:"retentionPeriodHrs,omitempty"`
|
2018-09-12 19:24:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OnboardingService represents a service for the first run.
|
|
|
|
type OnboardingService interface {
|
2018-10-03 14:51:14 +00:00
|
|
|
BasicAuthService
|
|
|
|
BucketService
|
|
|
|
OrganizationService
|
|
|
|
UserService
|
|
|
|
AuthorizationService
|
|
|
|
|
2018-09-12 19:24:17 +00:00
|
|
|
// IsOnboarding determine if onboarding request is allowed.
|
|
|
|
IsOnboarding(ctx context.Context) (bool, error)
|
|
|
|
// Generate OnboardingResults.
|
|
|
|
Generate(ctx context.Context, req *OnboardingRequest) (*OnboardingResults, error)
|
|
|
|
}
|