custom

package
v0.0.0-...-9b3c2d9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, sourceId string) error

Delete is a method to delete an existing custom event source using its ID.

Types

type CreateOpts

type CreateOpts struct {
	// The ID of the event channel to which the custom event source belongs.
	ChannelId string `json:"channel_id" required:"true"`
	// The name of the custom event source.
	Name string `json:"name" required:"true"`
	// The type of custom event source.
	// The valid values are as follows:
	// + APPLICATION (default)
	// + RABBITMQ
	// + ROCKETMQ
	Type string `json:"type,omitempty"`
	// The description of the custom event source.
	Description string `json:"description,omitempty"`
	// The configuration detail of the event source, in JSON format.
	Detail interface{} `json:"detail,omitempty"`
}

CreateOpts is the structure used to create a new custom event source.

type EventType

type EventType struct {
	// The name of the event type.
	Name string `json:"name"`
	// The description of the event type.
	Description string `json:"description"`
}

EventType is the structure that represents the event type that provided by the event source.

type ListOpts

type ListOpts struct {
	// The ID of the event channel to which the event source belongs.
	ChannelId string `q:"channel_id"`
	// Offset from which the query starts.
	// If the offset is less than 0, the value is automatically converted to 0.
	// The valid value ranges from 0 to 100, defaults to 0.
	Offset int `q:"offset"`
	// Number of items displayed on each page.
	// The valid value ranges from 1 to 1000, defaults to 15.
	Limit int `q:"limit"`
	// The query sorting.
	// The default value is 'created_time:DESC'.
	Sort string `q:"sort"`
	// The type of the event source provider.
	// + OFFICIAL: official cloud service event source.
	// + CUSTOM: the user-defined event source.
	// + PARTNER: partner event source.
	ProviderType string `q:"provider_type"`
	// The name of the event source.
	Name string `q:"name"`
	// The fuzzy name of the event source.
	FuzzyName string `q:"fuzzy_name"`
	// The fuzzy label of the event source.
	FuzzyLabel string `q:"fuzzy_label"`
}

ListOpts is the structure used to query event source list.

type Source

type Source struct {
	// The ID of the event source.
	ID string `json:"id"`
	// The name of the event source.
	Name string `json:"name"`
	// The description of the event source.
	Description string `json:"description"`
	// The type of the event source provider.
	// + OFFICIAL: official cloud service event source.
	// + CUSTOM: the user-defined event source.
	// + PARTNER: partner event source.
	ProviderType string `json:"provider_type"`
	// The list of event types provided by the event source.
	// Only the official cloud service event source provides event types.
	EventTypes []EventType `json:"event_types"`
	// The creation time, in UTC format.
	CreatedTime string `json:"created_time"`
	// The update time, in UTC format.
	UpdatedTime string `json:"updated_time"`
	// The ID of the event channel to which the event source belongs.
	ChannelId string `json:"channel_id"`
	// The name of the event channel to which the event source belongs.
	ChannelName string `json:"channel_name"`
	// The type of the event source.
	// + APPLICATION (default)
	// + RABBITMQ
	// + ROCKETMQ
	Type string `json:"type"`
	// The configuration detail of the event source, in JSON format.
	Detail interface{} `json:"detail"`
	// The status of the event source
	Status string `json:"status"`
}

Source is the structure that represents the event source detail.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Source, error)

Create is a method used to create a new custom event source using given parameters.

func ExtractSources

func ExtractSources(r pagination.Page) ([]Source, error)

ExtractSources is a method to extract the list of custom event sources.

func Get

func Get(client *golangsdk.ServiceClient, sourceId string) (*Source, error)

Get is a method to query an existing event source by its ID.

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Source, error)

List is a method to query the event source list using given parameters.

func Update

func Update(client *golangsdk.ServiceClient, opts UpdateOpts) (*Source, error)

Update is a method used to modify an existing custom event source using given parameters.

type SourcePage

type SourcePage struct {
	pagination.OffsetPageBase
}

SourcePage is a single page maximum result representing a query by offset page.

func (SourcePage) IsEmpty

func (b SourcePage) IsEmpty() (bool, error)

IsEmpty checks whether a SourcePage struct is empty.

type UpdateOpts

type UpdateOpts struct {
	// The ID of the event source.
	SourceId string `json:"-" required:"true"`
	// The description of the event source.
	Description *string `json:"description,omitempty"`
	// The configuration detail of the event source, in JSON format.
	Detail interface{} `json:"detail,omitempty"`
}

UpdateOpts is the structure used to update an existing custom event source.

Jump to

Keyboard shortcuts

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