apikey

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotExists = "api key does not exists"
)

Errors

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

APIKey response from create method

type Client

type Client struct {
}

Client is a struct for service account client

func (*Client) APIKeyCreate

func (c *Client) APIKeyCreate(resource string, description string, serviceAccount string, environment string) (APIKey, error)

APIKeyCreate create API key

func (*Client) APIKeyDelete

func (c *Client) APIKeyDelete(key string) error

APIKeyDelete delete API key by key

func (*Client) APIKeyUpdate

func (c *Client) APIKeyUpdate(key string, description string) error

APIKeyUpdate update API key description by key

func (*Client) GetAPIKeyByKey

func (c *Client) GetAPIKeyByKey(key string) (Metadata, error)

GetAPIKeyByKey get API key by key

type IClient

type IClient interface {
	APIKeyCreate(resource string, description string, serviceAccount string, environment string) (APIKey, error)
	APIKeyDelete(key string) error
	GetAPIKeyByKey(key string) (Metadata, error)
	APIKeyUpdate(key string, description string) error
}

IClient interface for service account client

func NewClient

func NewClient() IClient

NewClient is a factory method for apikey client

type List

type List []Metadata

List response from list method

type Metadata

type Metadata struct {
	Created         string `json:"created"`
	Description     string `json:"description"`
	Key             string `json:"key"`
	OwnerEmail      string `json:"owner_email"`
	OwnerResourceID string `json:"owner_resource_id"`
	ResourceID      string `json:"resource_id"`
	ResourceType    string `json:"resource_type"`
}

Metadata response from get/list method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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