roles

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 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 `Role`
	StatusActive = "active"
	// StatusPending is the pending value of the `Status` field in `Role`
	StatusPending = "pending"
	// StatusError is the error value of the `Status` field in `Role`
	StatusError = "error"
	// StatusDeleting is the deleting value of the `Status` field in `Role`
	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, role CreateRoleRequest) (int, error)

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

func (*API) Delete

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

Delete will destroy an existing role.

func (API) Get added in v0.5.1

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

Get has to use the List behaviour to simulate getById

func (API) List

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

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

func (*API) Update

func (a *API) Update(ctx context.Context, id int, role CreateRoleRequest) error

Update will make changes to an existing role.

type CreateDatabaseInRuleInRoleRequest

type CreateDatabaseInRuleInRoleRequest struct {
	SubscriptionId *int      `json:"subscriptionId,omitempty"`
	DatabaseId     *int      `json:"databaseId,omitempty"`
	Regions        []*string `json:"regions,omitempty"`
}

func (CreateDatabaseInRuleInRoleRequest) String

type CreateRoleRequest

type CreateRoleRequest struct {
	Name       *string                    `json:"name,omitempty"`
	RedisRules []*CreateRuleInRoleRequest `json:"redisRules,omitempty"`
}

func (CreateRoleRequest) String

func (o CreateRoleRequest) String() string

type CreateRuleInRoleRequest

type CreateRuleInRoleRequest struct {
	RuleName  *string                              `json:"ruleName,omitempty"`
	Databases []*CreateDatabaseInRuleInRoleRequest `json:"databases,omitempty"`
}

func (CreateRuleInRoleRequest) String

func (o CreateRuleInRoleRequest) String() string

type GetDatabaseInRuleInRoleResponse

type GetDatabaseInRuleInRoleResponse struct {
	SubscriptionId *int      `json:"subscriptionId,omitempty"`
	DatabaseId     *int      `json:"databaseId,omitempty"`
	DatabaseName   *string   `json:"databaseName,omitempty"`
	Regions        []*string `json:"regions,omitempty"`
}

func (GetDatabaseInRuleInRoleResponse) String

type GetRoleResponse

type GetRoleResponse struct {
	ID         *int                     `json:"id,omitempty"`
	Name       *string                  `json:"name,omitempty"`
	RedisRules []*GetRuleInRoleResponse `json:"redisRules,omitempty"`
	Users      []*GetUserInRoleResponse `json:"users,omitempty"`
	Status     *string                  `json:"status,omitempty"`
}

func (GetRoleResponse) String

func (o GetRoleResponse) String() string

type GetRuleInRoleResponse

type GetRuleInRoleResponse struct {
	RuleId    *int                               `json:"ruleId,omitempty"`
	RuleName  *string                            `json:"ruleName,omitempty"`
	Databases []*GetDatabaseInRuleInRoleResponse `json:"databases,omitempty"`
}

func (GetRuleInRoleResponse) String

func (o GetRuleInRoleResponse) String() string

type GetUserInRoleResponse

type GetUserInRoleResponse struct {
	ID   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

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 ListRolesResponse

type ListRolesResponse struct {
	AccountId *int               `json:"accountId,omitempty"`
	Roles     []*GetRoleResponse `json:"roles,omitempty"`
}

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