trigger

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FGS     = "fgs"
	TRIGGER = "triggers"
)

Variables

This section is empty.

Functions

func List

List is a method to obtain an array of one or more trigger for function graph according to the urn.

Types

type CreateOpts

type CreateOpts struct {
	// Trigger type, which support:
	//   TIMER
	//   APIG
	//   CTS
	//   DDS
	//   DMS
	//   DIS
	//   LTS
	//   OBS
	//   KAFKA
	//   SMN
	TriggerTypeCode string `json:"trigger_type_code" required:"true"`
	// Trigger status, which support:
	//   ACTIVE
	//   DISABLED
	TriggerStatus string `json:"trigger_status,omitempty"`
	// Message code.
	EventTypeCode string `json:"event_type_code" required:"true"`
	// Event struct.
	EventData map[string]interface{} `json:"event_data" required:"true"`
}

CreateOpts is a struct which will be used to create a new trigger.

func (CreateOpts) ToCreateTriggerMap

func (opts CreateOpts) ToCreateTriggerMap() (map[string]interface{}, error)

ToCreateTriggerMap is a method which to build a request body by the CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToCreateTriggerMap() (map[string]interface{}, error)
}

CreateOptsBuilder is an interface used to support the construction of the request body for trigger creates.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents a result of the Create method.

func Create

Create is a method to create trigger through function urn and CreateOpts.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Trigger, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents a result of the Delete method.

func Delete

func Delete(c *golangsdk.ServiceClient, urn, triggerType, triggerId string) (r DeleteResult)

Delete is a method to delete existing trigger.

func DeleteAll

func DeleteAll(c *golangsdk.ServiceClient, urn string) (r DeleteResult)

DeleteAll is a method to delete all triggers from a function

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents a result of the Update method.

func Get

func Get(c *golangsdk.ServiceClient, urn, triggerType, triggerId string) (r GetResult)

Get is a method to obtain a trigger through function urn, function code and trigger ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Trigger, error)

type Trigger

type Trigger struct {
	TriggerId       string                 `json:"trigger_id"`
	TriggerTypeCode string                 `json:"trigger_type_code"`
	EventData       map[string]interface{} `json:"event_data"`
	EventTypeCode   string                 `json:"event_type_code"`
	Status          string                 `json:"trigger_status"`
	LastUpdatedTime string                 `json:"last_updated_time"`
	CreatedTime     string                 `json:"created_time"`
	LastError       string                 `json:"last_error"`
}

Trigger is a struct that represents the result of Create and Get methods.

func ExtractList

func ExtractList(r pagination.Page) ([]Trigger, error)

ExtractList is a method which to extract the response to a trigger list.

type TriggerPage

type TriggerPage struct {
	pagination.SinglePageBase
}

TriggerPage represents the response pages of the List method.

type UpdateOpts

type UpdateOpts struct {
	TriggerStatus string `json:"trigger_status" required:"true"`
}

UpdateOpts is a struct which will be used to update existing trigger.

func (UpdateOpts) ToUpdateTriggerMap

func (opts UpdateOpts) ToUpdateTriggerMap() (map[string]interface{}, error)

ToUpdateTriggerMap is a method which to build a request body by the UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToUpdateTriggerMap() (map[string]interface{}, error)
}

UpdateOptsBuilder is an interface used to support the construction of the request body for trigger updates.

type UpdateResult

type UpdateResult struct {
	golangsdk.ErrResult
}

UpdateResult represents a result of the Update method.

func Update

func Update(c *golangsdk.ServiceClient, opts UpdateOptsBuilder, urn, triggerType, triggerId string) (r UpdateResult)

Update is a method to update existing trigger through function urn, function code, trigger ID and UpdateOpts.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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