satelliteadminclient

package
v1.84.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error is a class of satellite admin client errors.
	Error = errs.Class("satellite admin client")

	// ErrNotFound is an error returned when the resource did not exist.
	ErrNotFound = Error.New("not found")
)

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Status  string
	Message string `json:"message"`
	Detail  string `json:"detail"`
}

APIError is a satellite admin API error.

func (APIError) Error

func (e APIError) Error() string

type APIKey

type APIKey struct {
	ID        uuid.UUID `json:"id,omitempty"`
	Name      string    `json:"name,omitempty"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
}

APIKey is a satellite api key.

type APIKeyResponse

type APIKeyResponse struct {
	APIKey  APIKey  `json:"api_key,omitempty"`
	Project Project `json:"project,omitempty"`
	Owner   User    `json:"owner,omitempty"`
}

APIKeyResponse is a response when looking up API key information from the satellite.

type Client

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

Client is a satellite admin client.

func New

func New(baseURL, authToken string, log *log.Logger) *Client

New returns a new satellite admin client.

func (*Client) DeleteAPIKey

func (c *Client) DeleteAPIKey(ctx context.Context, apiKey string) error

DeleteAPIKey deletes the given API key from the satellite. See https://github.com/storj/storj/tree/main/satellite/admin#delete-apiapikeysapikey

func (*Client) GetAPIKey

func (c *Client) GetAPIKey(ctx context.Context, apiKey string) (APIKeyResponse, error)

GetAPIKey gets information on the given API key from the satellite. See https://github.com/storj/storj/tree/main/satellite/admin#get-apiapikeysapikey

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, email string) (UserResponse, error)

GetUser gets given user information from the satellite. See https://github.com/storj/storj/tree/main/satellite/admin#get-apiusersuser-email

func (*Client) SetProjectLimits

func (c *Client) SetProjectLimits(ctx context.Context, projectID string, limits url.Values) error

SetProjectLimits sets the project limits. See https://github.com/storj/storj/tree/main/satellite/admin#update-limits

func (*Client) ViolationFreezeAccount

func (c *Client) ViolationFreezeAccount(ctx context.Context, email string) error

ViolationFreezeAccount freezes the given user's account on the satellite so no upload or downloads may occur. See https://github.com/storj/storj/tree/main/satellite/admin#put-apiusersuser-emailviolation-freeze

type Project

type Project struct {
	ID   uuid.UUID `json:"id,omitempty"`
	Name string    `json:"name,omitempty"`
}

Project is a satellite project.

type User

type User struct {
	ID       uuid.UUID `json:"id,omitempty"`
	FullName string    `json:"fullName,omitempty"`
	Email    string    `json:"email,omitempty"`
	PaidTier bool      `json:"paidTier,omitempty"`
}

User is a satellite user.

type UserResponse

type UserResponse struct {
	User     User      `json:"user,omitempty"`
	Projects []Project `json:"projects,omitempty"`
}

UserResponse is a response when looking up a user information from the satellite.

Jump to

Keyboard shortcuts

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