Help us shape the future of Go! Take the 2026 Go Developer Survey

apisix

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound         = fmt.Errorf("not found")
	ErrStillInUse       = errors.New("still in use") // We should use force mode
	ErrFunctionDisabled = errors.New("function disabled")
)

Functions

func GetResourceUniqueKey added in v0.2.0

func GetResourceUniqueKey(resource interface{}) string

Types

type Client

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

type Cluster

type Cluster interface {
	Route() Route
	Service() Service
	Consumer() Consumer
	SSL() SSL
	GlobalRule() GlobalRule
	PluginConfig() PluginConfig
	ConsumerGroup() ConsumerGroup
	PluginMetadata() PluginMetadata
}

func NewCluster

func NewCluster(ctx context.Context, url, adminKey string) Cluster

type Consumer added in v0.2.0

type Consumer interface {
	ResourceClient[types.Consumer]
}

type ConsumerGroup added in v0.2.0

type ConsumerGroup interface {
	ResourceClient[types.ConsumerGroup]
}

type GlobalRule added in v0.2.0

type GlobalRule interface {
	ResourceClient[types.GlobalRule]
}

type IntOrString

type IntOrString struct {
	IntValue int `json:"int_value"`
}

IntOrString processing number and string types, after json deserialization will output int

func (*IntOrString) UnmarshalJSON

func (ios *IntOrString) UnmarshalJSON(p []byte) error

type PluginConfig added in v0.2.0

type PluginConfig interface {
	ResourceClient[types.PluginConfig]
}

type PluginMetadata added in v0.2.0

type PluginMetadata interface {
	ResourceClient[types.PluginMetadata]
}

type ResourceClient added in v0.2.0

type ResourceClient[T any] interface {
	Get(ctx context.Context, name string) (*T, error)
	List(ctx context.Context) ([]*T, error)
	Create(ctx context.Context, ups *T) (*T, error)
	Delete(ctx context.Context, name string) error
	Update(ctx context.Context, ups *T) (*T, error)
	Validate(ctx context.Context, resource *T) error
}

type Route

type Route interface {
	ResourceClient[types.Route]
}

type SSL added in v0.2.0

type SSL interface {
	ResourceClient[types.SSL]
}

type Service

type Service interface {
	ResourceClient[types.Service]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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