storage

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultK8sSecret = "dunebot-token-storage"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStorage

type FileStorage struct {
	File string
}

func NewFileStorage

func NewFileStorage(file string) *FileStorage

func (*FileStorage) Load

func (s *FileStorage) Load() (map[string]*proto.Installation, error)

func (*FileStorage) Save

func (s *FileStorage) Save(tokens map[string]*proto.Installation) error

type K8sConfigReadder

type K8sConfigReadder func() (*rest.Config, error)

func InClusterConfig

func InClusterConfig() K8sConfigReadder

type K8sStorage

type K8sStorage struct {
	Clientset kubernetes.Interface
	Namespace string
}

func NewK8sStorage

func NewK8sStorage(namespace string, k8sConfig K8sConfigReadder) (*K8sStorage, error)

func (*K8sStorage) GetSecret

func (s *K8sStorage) GetSecret() (*v1.Secret, error)

func (*K8sStorage) Load

func (s *K8sStorage) Load() (map[string]*proto.Installation, error)

func (*K8sStorage) Save

func (s *K8sStorage) Save(tokens map[string]*proto.Installation) error

type Storage

type Storage interface {
	Load() (map[string]*proto.Installation, error)
	Save(tokens map[string]*proto.Installation) error
}

Jump to

Keyboard shortcuts

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