redis_rules

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// StatusActive is the active value of the `Status` field in `RedisRule`
	StatusActive = "active"
	// StatusPending is the pending value of the `Status` field in `RedisRule`
	StatusPending = "pending"
	// StatusError is the error value of the `Status` field in `RedisRule`
	StatusError = "error"
	// StatusDeleting is the deleting value of the `Status` field in `RedisRule`
	StatusDeleting = "deleting"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(client HttpClient, taskWaiter TaskWaiter, logger Log) *API

func (*API) Create

func (a *API) Create(ctx context.Context, redisRule CreateRedisRuleRequest) (int, error)

Create will create a new redisRule and return the identifier of the redisRule.

func (*API) Delete

func (a *API) Delete(ctx context.Context, id int) error

Delete will destroy an existing redisRule.

func (API) Get added in v0.5.1

func (a API) Get(ctx context.Context, id int) (*GetRedisRuleResponse, error)

Get has to use the List behaviour to simulate getById

func (API) List

func (a API) List(ctx context.Context) ([]*GetRedisRuleResponse, error)

List will list all of the current account's redisRules.

func (*API) Update

func (a *API) Update(ctx context.Context, id int, redisRule CreateRedisRuleRequest) error

Update will make changes to an existing redisRule.

type CreateRedisRuleRequest

type CreateRedisRuleRequest struct {
	Name      *string `json:"name,omitempty"`
	RedisRule *string `json:"redisRule,omitempty"`
}

func (CreateRedisRuleRequest) String

func (o CreateRedisRuleRequest) String() string

type GetRedisRuleResponse

type GetRedisRuleResponse struct {
	ID        *int    `json:"id,omitempty"`
	Name      *string `json:"name,omitempty"`
	ACL       *string `json:"acl,omitempty"`
	IsDefault *bool   `json:"isDefault,omitempty"`
	Status    *string `json:"status,omitempty"`
}

func (GetRedisRuleResponse) String

func (o GetRedisRuleResponse) String() string

type HttpClient

type HttpClient interface {
	Get(ctx context.Context, name, path string, responseBody interface{}) error
	Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Delete(ctx context.Context, name, path string, responseBody interface{}) error
}

type ListRedisRulesResponse

type ListRedisRulesResponse struct {
	AccountId  *int                    `json:"accountId,omitempty"`
	RedisRules []*GetRedisRuleResponse `json:"redisRules,omitempty"`
}

func (ListRedisRulesResponse) String

func (o ListRedisRulesResponse) String() string

type Log

type Log interface {
	Printf(format string, args ...interface{})
}

type NotFound added in v0.5.1

type NotFound struct {
	ID int
}

func (*NotFound) Error added in v0.5.1

func (f *NotFound) Error() string

type TaskWaiter added in v0.9.0

type TaskWaiter interface {
	WaitForResourceId(ctx context.Context, id string) (int, error)
	Wait(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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