cis

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerClient

type BrokerClient interface {
	Deprovision(instance internal.Instance) (string, error)
}

type CisClient

type CisClient interface {
	FetchSubaccountsToDelete() ([]string, error)
}

type CisResponse

type CisResponse struct {
	Total      int     `json:"total"`
	TotalPages int     `json:"totalPages"`
	PageNum    int     `json:"pageNum"`
	Events     []Event `json:"events"`
}

type CisResponseVer1

type CisResponseVer1 struct {
	Total      int         `json:"totalResults"`
	TotalPages int         `json:"totalPages"`
	Events     []EventVer1 `json:"events"`
}

type Client

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

func NewClient

func NewClient(ctx context.Context, config Config, log logrus.FieldLogger) *Client

func (*Client) FetchSubaccountsToDelete

func (c *Client) FetchSubaccountsToDelete() ([]string, error)

func (*Client) SetHttpClient

func (c *Client) SetHttpClient(httpClient *http.Client)

SetHttpClient auxiliary method of testing to get rid of oAuth client wrapper

type ClientVer1

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

func NewClientVer1

func NewClientVer1(ctx context.Context, config Config, log logrus.FieldLogger) *ClientVer1

func (*ClientVer1) FetchSubaccountsToDelete

func (c *ClientVer1) FetchSubaccountsToDelete() ([]string, error)

func (*ClientVer1) SetHttpClient

func (c *ClientVer1) SetHttpClient(httpClient *http.Client)

SetHttpClient auxiliary method of testing to get rid of oAuth client wrapper

type Config

type Config struct {
	ClientID             string
	ClientSecret         string
	AuthURL              string
	EventServiceURL      string
	PageSize             string        `envconfig:"optional"`
	RateLimitingInterval time.Duration `envconfig:"default=2s,optional"`
	MaxRequestRetries    int           `envconfig:"default=3,optional"`
}

type Event

type Event struct {
	CreationTime int64  `json:"creationTime"`
	SubAccount   string `json:"entityId"`
	Type         string `json:"eventType"`
}

type EventDataVer1

type EventDataVer1 struct {
	SubAccount string `json:"subaccountGuid"`
}

type EventVer1

type EventVer1 struct {
	Type string        `json:"type"`
	Data EventDataVer1 `json:"eventData"`
}

type SubAccountCleanupService

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

func NewSubAccountCleanupService

func NewSubAccountCleanupService(client CisClient, brokerClient BrokerClient, storage storage.Instances, log logrus.FieldLogger) *SubAccountCleanupService

func (*SubAccountCleanupService) Run

func (ac *SubAccountCleanupService) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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