pitch-content-management-sdk

command module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 6 Imported by: 0

README

pitch-content-management-sdk

This is our Content Management SDK for the API documented below.

One of the products that is currently using this API is Snowpal Project Management.

Documentation

Overview

Check out the recipes to get a sense of what the underlying API has to offer. Here's a simple example:

package main

import (
	"strconv"

	log "github.com/sirupsen/logrus"

	"os"

	"github.com/snowpal/pitch-content-management-sdk/lib/config"
	"github.com/snowpal/pitch-content-management-sdk/lib/recipes"
)

func main() {
	var err error
	if config.Files, err = config.InitConfigFiles(); err != nil {
		log.Fatal(err.Error())
		return
	}

	var recipeID int
	recipeIDInEnv := os.Getenv("RECIPE_ID")
	if len(recipeIDInEnv) == 0 {
		recipeID = 1
	} else {
		recipeID, err = strconv.Atoi(recipeIDInEnv)
		if err != nil {
			recipeID = 1
		}
	}

	switch recipeID {
	case 1:
		log.Info("Run Recipe1")
		recipes.RegisterFewUsers()
		break
	case 2:
		log.Info("Run Recipe2")
		recipes.GetResourceAttributes()
		break
	case 3:
		log.Info("Run Recipe3")
		recipes.CreatePrivateConversation()
		break
	case 4:
		log.Info("Run Recipe4")
		recipes.AddAndLinkResources()
		break
	case 5:
		log.Info("Run Recipe5")
		recipes.ShareBlock()
		break
	case 6:
		log.Info("Run Recipe6")
		recipes.GetAllKeys()
		break
	case 7:
		log.Info("Run Recipe7")
		recipes.AddFavorite()
		break
	case 8:
		log.Info("Run Recipe8")
		recipes.FetchScheduler()
		break
	case 9:
		log.Info("Run Recipe9")
		recipes.AddRelation()
		break
	case 10:
		log.Info("Run Recipe10")
		recipes.GrantAclOnCustomBlock()
		break
	case 11:
		log.Info("Run Recipe11")
		recipes.UpdateAttributes()
		break
	default:
		log.Info("pick a specific recipe to run")
	}
}

For a full guide, visit https://developers.snowpal.com

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

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