apikeyrepository

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BucketName represents the name of the bucket where this service stores data.
	BucketName = "api_key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service represents a service for managing api-key data.

func NewService

func NewService(connection portainer.Connection) (*Service, error)

NewService creates a new instance of a service.

func (*Service) CreateAPIKey

func (service *Service) CreateAPIKey(record *portainer.APIKey) error

CreateAPIKey creates a new APIKey object.

func (*Service) DeleteAPIKey

func (service *Service) DeleteAPIKey(ID portainer.APIKeyID) error

func (*Service) GetAPIKey

func (service *Service) GetAPIKey(keyID portainer.APIKeyID) (*portainer.APIKey, error)

GetAPIKey retrieves an existing APIKey object by api key ID.

func (*Service) GetAPIKeyByDigest

func (service *Service) GetAPIKeyByDigest(digest []byte) (*portainer.APIKey, error)

GetAPIKeyByDigest returns the API key for the associated digest. Note: there is a 1-to-1 mapping of api-key and digest

func (*Service) GetAPIKeysByUserID

func (service *Service) GetAPIKeysByUserID(userID portainer.UserID) ([]portainer.APIKey, error)

GetAPIKeysByUserID returns a slice containing all the APIKeys a user has access to.

func (*Service) UpdateAPIKey

func (service *Service) UpdateAPIKey(key *portainer.APIKey) error

Jump to

Keyboard shortcuts

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