Documentation ¶
Index ¶
- Variables
- func NewErrIncorrectChannelName(chnl string) error
- func NewErrIncorrectTargetPath(path string) error
- func SplitFilepath(path string) (result []string)
- type Filesystem
- type InMemoryFile
- type Interface
- type NonAtomicTufStore
- func (m *NonAtomicTufStore) Clean() error
- func (store *NonAtomicTufStore) Commit(consistentSnapshot bool, versions map[string]int, _ map[string]data.Hashes) error
- func (store *NonAtomicTufStore) GetMeta() (map[string]json.RawMessage, error)
- func (store *NonAtomicTufStore) GetSigningKeys(role string) ([]sign.Signer, error)
- func (store *NonAtomicTufStore) SavePrivateKey(role string, key *sign.PrivateKey) error
- func (store *NonAtomicTufStore) SetMeta(name string, meta json.RawMessage) error
- func (store *NonAtomicTufStore) StageTargetFile(ctx context.Context, path string, data io.Reader) error
- func (store *NonAtomicTufStore) WalkStagedTargets(paths []string, targetsFn tuf.TargetsWalkFunc) error
- type Publisher
- func (publisher *Publisher) GetRepository(ctx context.Context, storage logical.Storage, options RepositoryOptions) (RepositoryInterface, error)
- func (m *Publisher) Paths() []*framework.Path
- func (m *Publisher) PeriodicFunc(_ context.Context, _ *logical.Request) error
- func (publisher *Publisher) RotateRepositoryKeys(ctx context.Context, storage logical.Storage, repository RepositoryInterface) error
- func (publisher *Publisher) StageChannelsConfig(ctx context.Context, repository RepositoryInterface, ...) error
- func (publisher *Publisher) StageInMemoryFiles(ctx context.Context, repository RepositoryInterface, files []*InMemoryFile) error
- func (publisher *Publisher) StageReleaseTarget(ctx context.Context, repository RepositoryInterface, releaseName, path string, ...) error
- func (publisher *Publisher) UpdateTimestamps(ctx context.Context, storage logical.Storage, repository RepositoryInterface) error
- type RepositoryInterface
- type RepositoryOptions
- type S3Filesystem
- func (fs *S3Filesystem) IsFileExist(ctx context.Context, path string) (bool, error)
- func (fs *S3Filesystem) ReadFile(ctx context.Context, path string, writerAt io.WriterAt) error
- func (fs *S3Filesystem) ReadFileBytes(ctx context.Context, path string) ([]byte, error)
- func (fs *S3Filesystem) ReadFileStream(ctx context.Context, path string, writer io.Writer) error
- func (fs *S3Filesystem) WriteFileBytes(ctx context.Context, path string, data []byte) error
- func (fs *S3Filesystem) WriteFileStream(ctx context.Context, path string, data io.Reader) error
- type S3Options
- type S3Repository
- func (repository *S3Repository) CommitStaged(_ context.Context) error
- func (repository *S3Repository) GenPrivKeys() error
- func (repository *S3Repository) GetPrivKeys() TufRepoPrivKeys
- func (repository *S3Repository) Init() error
- func (repository *S3Repository) RotatePrivKeys(ctx context.Context) (bool, TufRepoPrivKeys, error)
- func (repository *S3Repository) SetPrivKeys(privKeys TufRepoPrivKeys) error
- func (repository *S3Repository) StageTarget(ctx context.Context, pathInsideTargets string, data io.Reader) error
- func (repository *S3Repository) UpdateTimestamps(_ context.Context) error
- type TufRepoOptions
- type TufRepoPrivKeys
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUninitializedRepositoryKeys = errors.New("uninitialized repository keys")
Functions ¶
func SplitFilepath ¶
TODO: move this to the separate project in github.com/werf
Types ¶
type Filesystem ¶
type Filesystem interface { IsFileExist(ctx context.Context, path string) (bool, error) ReadFile(ctx context.Context, path string, writer io.WriterAt) error ReadFileStream(ctx context.Context, path string, writer io.Writer) error ReadFileBytes(ctx context.Context, path string) ([]byte, error) WriteFileBytes(ctx context.Context, path string, data []byte) error WriteFileStream(ctx context.Context, path string, reader io.Reader) error }
type InMemoryFile ¶
type Interface ¶
type Interface interface { GetRepository(ctx context.Context, storage logical.Storage, options RepositoryOptions) (RepositoryInterface, error) RotateRepositoryKeys(ctx context.Context, storage logical.Storage, repository RepositoryInterface) error UpdateTimestamps(ctx context.Context, storage logical.Storage, repository RepositoryInterface) error StageReleaseTarget(ctx context.Context, repository RepositoryInterface, releaseName, path string, data io.Reader) error StageChannelsConfig(ctx context.Context, repository RepositoryInterface, trdlChannelsConfig *config.TrdlChannels) error StageInMemoryFiles(ctx context.Context, repository RepositoryInterface, files []*InMemoryFile) error }
type NonAtomicTufStore ¶
type NonAtomicTufStore struct { PrivKeys TufRepoPrivKeys Filesystem Filesystem // contains filtered or unexported fields }
func NewNonAtomicTufStore ¶
func NewNonAtomicTufStore(privKeys TufRepoPrivKeys, filesystem Filesystem) *NonAtomicTufStore
func (*NonAtomicTufStore) Clean ¶
func (m *NonAtomicTufStore) Clean() error
func (*NonAtomicTufStore) GetMeta ¶
func (store *NonAtomicTufStore) GetMeta() (map[string]json.RawMessage, error)
func (*NonAtomicTufStore) GetSigningKeys ¶
func (store *NonAtomicTufStore) GetSigningKeys(role string) ([]sign.Signer, error)
func (*NonAtomicTufStore) SavePrivateKey ¶
func (store *NonAtomicTufStore) SavePrivateKey(role string, key *sign.PrivateKey) error
func (*NonAtomicTufStore) SetMeta ¶
func (store *NonAtomicTufStore) SetMeta(name string, meta json.RawMessage) error
func (*NonAtomicTufStore) StageTargetFile ¶
func (*NonAtomicTufStore) WalkStagedTargets ¶
func (store *NonAtomicTufStore) WalkStagedTargets(paths []string, targetsFn tuf.TargetsWalkFunc) error
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
func NewPublisher() *Publisher
func (*Publisher) GetRepository ¶
func (publisher *Publisher) GetRepository(ctx context.Context, storage logical.Storage, options RepositoryOptions) (RepositoryInterface, error)
func (*Publisher) PeriodicFunc ¶
func (*Publisher) RotateRepositoryKeys ¶
func (*Publisher) StageChannelsConfig ¶
func (publisher *Publisher) StageChannelsConfig(ctx context.Context, repository RepositoryInterface, trdlChannelsConfig *config.TrdlChannels) error
func (*Publisher) StageInMemoryFiles ¶
func (publisher *Publisher) StageInMemoryFiles(ctx context.Context, repository RepositoryInterface, files []*InMemoryFile) error
func (*Publisher) StageReleaseTarget ¶
func (*Publisher) UpdateTimestamps ¶
type RepositoryInterface ¶
type RepositoryInterface interface { Init() error SetPrivKeys(privKeys TufRepoPrivKeys) error GetPrivKeys() TufRepoPrivKeys GenPrivKeys() error RotatePrivKeys(ctx context.Context) (bool, TufRepoPrivKeys, error) UpdateTimestamps(ctx context.Context) error StageTarget(ctx context.Context, pathInsideTargets string, data io.Reader) error CommitStaged(ctx context.Context) error }
type RepositoryOptions ¶
type S3Filesystem ¶
func NewS3Filesystem ¶
func NewS3Filesystem(awsConfig *aws.Config, bucketName string) *S3Filesystem
func (*S3Filesystem) IsFileExist ¶
func (*S3Filesystem) ReadFileBytes ¶
func (*S3Filesystem) ReadFileStream ¶
func (*S3Filesystem) WriteFileBytes ¶
func (*S3Filesystem) WriteFileStream ¶
type S3Repository ¶
type S3Repository struct { S3Filesystem *S3Filesystem TufStore *NonAtomicTufStore TufRepo *tuf.Repo }
func NewRepository ¶
func NewRepository(s3Filesystem *S3Filesystem, tufStore *NonAtomicTufStore, tufRepo *tuf.Repo) *S3Repository
func NewRepositoryWithOptions ¶
func NewRepositoryWithOptions(s3Options S3Options, tufRepoOptions TufRepoOptions) (*S3Repository, error)
func (*S3Repository) CommitStaged ¶
func (repository *S3Repository) CommitStaged(_ context.Context) error
func (*S3Repository) GenPrivKeys ¶
func (repository *S3Repository) GenPrivKeys() error
func (*S3Repository) GetPrivKeys ¶
func (repository *S3Repository) GetPrivKeys() TufRepoPrivKeys
func (*S3Repository) Init ¶
func (repository *S3Repository) Init() error
func (*S3Repository) RotatePrivKeys ¶
func (repository *S3Repository) RotatePrivKeys(ctx context.Context) (bool, TufRepoPrivKeys, error)
func (*S3Repository) SetPrivKeys ¶
func (repository *S3Repository) SetPrivKeys(privKeys TufRepoPrivKeys) error
func (*S3Repository) StageTarget ¶
func (*S3Repository) UpdateTimestamps ¶
func (repository *S3Repository) UpdateTimestamps(_ context.Context) error
type TufRepoOptions ¶
type TufRepoOptions struct {
PrivKeys TufRepoPrivKeys
}
type TufRepoPrivKeys ¶
type TufRepoPrivKeys struct { Root *sign.PrivateKey `json:"root"` Snapshot *sign.PrivateKey `json:"snapshot"` Targets *sign.PrivateKey `json:"targets"` Timestamp *sign.PrivateKey `json:"timestamp"` }
Click to show internal directories.
Click to hide internal directories.