store

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 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 Certificate

type Certificate struct {
	Resource []byte    `json:"resource"`
	Cert     []byte    `json:"cert"`
	Key      []byte    `json:"key"`
	NotAfter time.Time `json:"notAfter"`
}

type FileStore

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

func (*FileStore) GetUser

func (fs *FileStore) GetUser(_ context.Context, email string) (user *User, has bool, err error)

func (*FileStore) GetUserCertificate

func (fs *FileStore) GetUserCertificate(_ context.Context, email string, domain string) (cert *Certificate, has bool, err error)

func (*FileStore) SaveUser

func (fs *FileStore) SaveUser(_ context.Context, user *User) (err error)

func (*FileStore) SaveUserCertificate

func (fs *FileStore) SaveUserCertificate(_ context.Context, email string, domain string, cert *Certificate) (err error)

type Store

type Store interface {
	GetUser(ctx context.Context, email string) (user *User, has bool, err error)
	SaveUser(ctx context.Context, user *User) (err error)
	GetUserCertificate(ctx context.Context, email string, domain string) (cert *Certificate, has bool, err error)
	SaveUserCertificate(ctx context.Context, email string, domain string, cert *Certificate) (err error)
}

func NewFileStore

func NewFileStore(rootDir string) (v Store, err error)

type User

type User struct {
	Email    string `json:"email"`
	Resource []byte `json:"resource"`
	Key      []byte `json:"key"`
}

func (*User) GetEmail

func (u *User) GetEmail() string

func (*User) GetPrivateKey

func (u *User) GetPrivateKey() crypto.PrivateKey

func (*User) GetRegistration

func (u *User) GetRegistration() *registration.Resource

Jump to

Keyboard shortcuts

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