campaign

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright © 2022 Flagship Team [email protected]

Copyright © 2022 Flagship Team [email protected]

Copyright © 2022 Flagship Team [email protected]

Copyright © 2022 Flagship Team [email protected]

Copyright © 2022 Flagship Team [email protected]

Copyright © 2022 Flagship Team [email protected]

Copyright © 2022 Flagship Team [email protected]

Index

Constants

This section is empty.

Variables

View Source
var (
	CampaignID string
	Status     string
	DataRaw    string
)
View Source
var CampaignCmd = &cobra.Command{
	Use:   "campaign [create|edit|get|list|delete|switch]",
	Short: "Manage your campaigns",
	Long:  `Manage your campaigns`,
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Help()
	},
}

campaignCmd represents the campaign command

View Source
var SwitchCmd = &cobra.Command{
	Use:   "switch [-i <campaign-id> | --id=<campaign-id>] [-s <status> | --status=<status>]",
	Short: "Switch a campaign state",
	Long:  `Switch a campaign state in your project`,
	Run: func(cmd *cobra.Command, args []string) {
		if !(Status == "active" || Status == "paused" || Status == "interrupted") {
			fmt.Fprintln(cmd.OutOrStdout(), "Status can only have 3 values: active or paused or interrupted")
		} else {
			err := httprequest.HTTPSwitchCampaign(CampaignID, Status)
			if err != nil {
				log.Fatalf("error occurred: %v", err)
			}
			fmt.Fprintf(cmd.OutOrStdout(), "campaign status set to %s\n", Status)
		}

	},
}

SwitchCmd represents the Switch command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL