Documentation ¶
Index ¶
- Constants
- type MattermostRequester
- type NameGenerator
- type ProvisionerRequester
- type Step
- type StepFunc
- type TestWicker
- func (w *TestWicker) AddTeamMember() func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) CreateChannel(retries int) func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) CreateIncomingWebhook() func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) CreateInstallation(request *cmodel.CreateInstallationRequest) func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) CreateTeam() func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) DeleteInstallation() func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) IsUP() func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) PostMessage(samples int, sleepDuration time.Duration) func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) SetupInstallation() func(w *TestWicker, ctx context.Context) error
- func (w *TestWicker) WaitForInstallationStable() func(w *TestWicker, ctx context.Context) error
- type Workflow
Constants ¶
const (
// MaxGeneratedNameLength is the max length of the generated name
MaxGeneratedNameLength = maxNameLength - randomLength
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MattermostRequester ¶
type MattermostRequester interface { GetPing() (string, *mmodel.Response) Logout() (bool, *mmodel.Response) CreateTeam(team *mmodel.Team) (*mmodel.Team, *mmodel.Response) AddTeamMember(teamID, userID string) (*mmodel.TeamMember, *mmodel.Response) CreatePost(post *mmodel.Post) (*mmodel.Post, *mmodel.Response) CreateUser(user *mmodel.User) (*mmodel.User, *mmodel.Response) CreateChannel(channel *mmodel.Channel) (*mmodel.Channel, *mmodel.Response) CreateIncomingWebhook(webhoo *mmodel.IncomingWebhook) (*mmodel.IncomingWebhook, *mmodel.Response) Login(username, password string) (*mmodel.User, *mmodel.Response) }
MattermostRequester the interface which describes mattermost API client
type NameGenerator ¶
type NameGenerator interface { // GenerateName generates a valid name from the base name, adding a random suffix to the // the base. If base is valid, the returned name must also be valid. The generator is // responsible for knowing the maximum valid name length. GenerateName(base string) string }
NameGenerator generates3 names for objects. Some backends may have more information available to guide selection of new names and this interface hides those details.
var SimpleNameGenerator NameGenerator = simpleNameGenerator{}
SimpleNameGenerator is a generator that returns the name plus a random suffix of five alphanumerics when a name is requested. The string is guaranteed to not exceed the length of a standard Kubernetes name (63 characters)
type ProvisionerRequester ¶
type ProvisionerRequester interface { CreateInstallation(request *cmodel.CreateInstallationRequest) (*cmodel.InstallationDTO, error) GetInstallation(id string, request *cmodel.GetInstallationRequest) (*cmodel.InstallationDTO, error) DeleteInstallation(id string) error }
ProvisionerRequester the interface which describes Provisioner API client
type StepFunc ¶
type StepFunc func(*TestWicker, context.Context) error
StepFunc the func to run for a step
type TestWicker ¶
type TestWicker struct {
// contains filtered or unexported fields
}
TestWicker data struct for test wicker scenarios
func NewTestWicker ¶
func NewTestWicker(provisionerRequester ProvisionerRequester, requester MattermostRequester, logger logrus.FieldLogger) *TestWicker
NewTestWicker creates a testwicker
func (*TestWicker) AddTeamMember ¶
func (w *TestWicker) AddTeamMember() func(w *TestWicker, ctx context.Context) error
AddTeamMember add the newly created user to a team in the installation
func (*TestWicker) CreateChannel ¶
func (w *TestWicker) CreateChannel(retries int) func(w *TestWicker, ctx context.Context) error
CreateChannel creates a channel so we can post couple of messages
func (*TestWicker) CreateIncomingWebhook ¶
func (w *TestWicker) CreateIncomingWebhook() func(w *TestWicker, ctx context.Context) error
CreateIncomingWebhook creates an incoming webhook
func (*TestWicker) CreateInstallation ¶
func (w *TestWicker) CreateInstallation(request *cmodel.CreateInstallationRequest) func(w *TestWicker, ctx context.Context) error
CreateInstallation interacts with provisioner and uses the provided request to create a new installation
func (*TestWicker) CreateTeam ¶
func (w *TestWicker) CreateTeam() func(w *TestWicker, ctx context.Context) error
CreateTeam creates a team in the installation
func (*TestWicker) DeleteInstallation ¶
func (w *TestWicker) DeleteInstallation() func(w *TestWicker, ctx context.Context) error
DeleteInstallation interacts with provisioner and uses the provided request to delete an installation
func (*TestWicker) IsUP ¶
func (w *TestWicker) IsUP() func(w *TestWicker, ctx context.Context) error
IsUP cpings the installation till return statusCode=200 and status=OK
func (*TestWicker) PostMessage ¶
func (w *TestWicker) PostMessage(samples int, sleepDuration time.Duration) func(w *TestWicker, ctx context.Context) error
PostMessage post messages to the different channels which are created automatically by the wicker
func (*TestWicker) SetupInstallation ¶
func (w *TestWicker) SetupInstallation() func(w *TestWicker, ctx context.Context) error
SetupInstallation creates a user and login with this one
func (*TestWicker) WaitForInstallationStable ¶
func (w *TestWicker) WaitForInstallationStable() func(w *TestWicker, ctx context.Context) error
WaitForInstallationStable waits for installation to become stable