models

package
v0.0.0-...-c37b31e Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveBadge

func RemoveBadge(id string) error

Types

type Badge

type Badge struct {
	ID         bson.ObjectId `json:"_id" bson:"_id"`
	Title      string        `json:"title" bson:"title"`
	Icon       string        `json:"icon" bson:"icon"`
	Type       string        `json:"type" bson:"type"`
	Appearance struct {
		Position string `json:"position" bson:"position"`
		Colors   struct {
			Background       string `json:"background" bson:"background"`
			Text             string `json:"text" bson:"text"`
			ButtonBackground string `json:"button_background" bson:"button_background"`
			ButtonText       string `json:"button_text" bson:"button_text"`
		} `json:"colors" bson:"colors"`
		Font string `json:"font" bson:"font"`
	} `json:"appearance" bson:"appearance"`
	Content struct {
		MainText   string `json:"main_text" bson:"main_text"`
		ButtonText string `json:"button_text" bson:"button_text"`
	} `json:"content" bson:"content"`
	Success struct {
		MainText  string `json:"main_text" bson:"main_text"`
		Behaviour struct {
			State string `json:"state" bson:"state"`
			Time  int32  `json:"time" bson:"time"`
		} `json:"behaviour" bson:"behaviour"`
	} `json:"success" bson:"success"`
	Questions []struct {
		QuestionTitle   string `json:"question_title" bson:"question_title"`
		QuestionType    string `json:"question_type" bson:"question_type"`
		QuestionOptions []struct {
			Default bool   `json:"default" bson:"default"`
			Option  string `json:"option" bson:"option"`
		} `json:"question_options,omitempty" bson:"question_options,omitempty"`
		Required bool `json:"required" bson:"required"`
	} `json:"questions,omitempty" bson:"questions,omitempty"`
	Status      string    `json:"status" bson:"status"` // active, deactive, removed...
	CreatedDate time.Time `json:"created_date" bson:"created_date"`
	UpdatedDate time.Time `json:"updated_date" bson:"updated_date"`
}

func CreateBadge

func CreateBadge(badge Badge) (*Badge, error)

func GetBadge

func GetBadge(id string) (*Badge, error)

func UpdateBadge

func UpdateBadge(badge Badge) (*Badge, error)

type Team

type Team struct {
	ID             string              `json:"_id" bson:"_id"`
	Name           string              `json:"name" bson:"name"`
	Domain         string              `json:"domain" bson:"domain"`
	EmailDomain    string              `json:"email_domain" bson:"email_domain"`
	Icon           slack.TeamInfoIcons `json:"icon" bson:"icon"`
	EnterpriseID   string              `json:"enterprise_id" bson:"enterprise_id"`
	EnterpriseName string              `json:"enterprise_name" bson:"enterprise_name"`
	AccessToken    string              `json:"access_token" bson:"access_token"`
	Subscription   bool                `json:"subscription" bson:"subscription"`
	SubscriptionID string              `json:"subscription_id" bson:"subscription_id"`
	RegisterDate   time.Time           `json:"register_date" bson:"register_date"`
}

func CreateTeam

func CreateTeam(id, name, domain, email_domain, enterprise_id, enterprise_name, access_token string, icons slack.TeamInfoIcons) (*Team, error)

func GetTeam

func GetTeam(id string) (*Team, error)

func UpdateTeam

func UpdateTeam(id, name, domain, email_domain, access_token string, icons slack.TeamInfoIcons) (*Team, error)

Jump to

Keyboard shortcuts

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