datastore

package
v0.0.0-...-be3d2a3 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2022 Evan Hazlett

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAccountDoesNotExist is returned when an account cannot be found
	ErrAccountDoesNotExist = errors.New("account does not exist")
)
View Source
var (
	// ErrJobNotFound is returned when the specified job cannot be found
	ErrJobNotFound = errors.New("job not found")
)

Functions

This section is empty.

Types

type ByCreatedAt

type ByCreatedAt []*api.Job

func (ByCreatedAt) Len

func (s ByCreatedAt) Len() int

func (ByCreatedAt) Less

func (s ByCreatedAt) Less(i, j int) bool

func (ByCreatedAt) Swap

func (s ByCreatedAt) Swap(i, j int)

type Datastore

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

func NewDatastore

func NewDatastore(cfg *fynca.Config) (*Datastore, error)

func (*Datastore) ChangePassword

func (d *Datastore) ChangePassword(ctx context.Context, account *api.Account, password []byte) error

func (*Datastore) ClearCacheObject

func (d *Datastore) ClearCacheObject(ctx context.Context, key string) error

func (*Datastore) ClearLatestRenderCache

func (d *Datastore) ClearLatestRenderCache(ctx context.Context, jobID string, frame int64) error

func (*Datastore) CompositeFrameRender

func (d *Datastore) CompositeFrameRender(ctx context.Context, jobID string, frame int64) ([]byte, error)

func (*Datastore) CreateAccount

func (d *Datastore) CreateAccount(ctx context.Context, account *api.Account) error

func (*Datastore) CreateJobArchive

func (d *Datastore) CreateJobArchive(ctx context.Context, jobID string) error

CreateJobArchive creates a zip archive of the job and stores a signed url from the storage service

func (*Datastore) DeleteAccount

func (d *Datastore) DeleteAccount(ctx context.Context, username string) error

func (*Datastore) DeleteJob

func (d *Datastore) DeleteJob(ctx context.Context, jobID string) error

DeleteJob deletes a job and all related files from the datastore

func (*Datastore) DeleteRenders

func (d *Datastore) DeleteRenders(ctx context.Context, id string) error

func (*Datastore) GetAccount

func (d *Datastore) GetAccount(ctx context.Context, username string) (*api.Account, error)

func (*Datastore) GetAccounts

func (d *Datastore) GetAccounts(ctx context.Context) ([]*api.Account, error)

func (*Datastore) GetAuthenticatorKey

func (d *Datastore) GetAuthenticatorKey(ctx context.Context, a auth.Authenticator, key string) ([]byte, error)

GetAuthenticatorKey is a helper func for authenticators to get authenticator specific keys

func (*Datastore) GetCacheObject

func (d *Datastore) GetCacheObject(ctx context.Context, key string) ([]byte, error)

func (*Datastore) GetCompositeRender

func (d *Datastore) GetCompositeRender(ctx context.Context, jobID string, frame int64, ttl time.Duration) (string, error)

func (*Datastore) GetJob

func (d *Datastore) GetJob(ctx context.Context, jobID string) (*api.Job, error)

GetJob returns a job by id from the datastore

func (*Datastore) GetJobArchiveStatus

func (d *Datastore) GetJobArchiveStatus(ctx context.Context, jobID string) (*api.JobArchive, error)

func (*Datastore) GetJobLog

func (d *Datastore) GetJobLog(ctx context.Context, jobID string) (*api.JobLog, error)

func (*Datastore) GetJobs

func (d *Datastore) GetJobs(ctx context.Context) ([]*api.Job, error)

GetJobs returns a list of jobs

func (*Datastore) GetLatestRender

func (d *Datastore) GetLatestRender(ctx context.Context, jobID string, frame int64, ttl time.Duration) (string, error)

func (*Datastore) GetRenderLog

func (d *Datastore) GetRenderLog(ctx context.Context, jobID string, frame int64, slice int64) (*api.RenderLog, error)

GetRenderLog gets the specified render log for the job

func (*Datastore) GetWorker

func (d *Datastore) GetWorker(ctx context.Context, name string) (*api.Worker, error)

func (*Datastore) GetWorkers

func (d *Datastore) GetWorkers(ctx context.Context) ([]*api.Worker, error)

func (*Datastore) ResolveJob

func (d *Datastore) ResolveJob(ctx context.Context, jobID string) error

ResolveJob resolves a job from all frame and slice jobs and stores the result in the database

func (*Datastore) SetAuthenticatorKey

func (d *Datastore) SetAuthenticatorKey(ctx context.Context, a auth.Authenticator, key string, value []byte, ttl time.Duration) error

SetAuthenticatorKey is a helper func for authenticators to store authenticator specific data

func (*Datastore) SetCacheObject

func (d *Datastore) SetCacheObject(ctx context.Context, key string, value []byte, ttl time.Duration) error

func (*Datastore) UpdateAccount

func (d *Datastore) UpdateAccount(ctx context.Context, account *api.Account) error

func (*Datastore) UpdateJob

func (d *Datastore) UpdateJob(ctx context.Context, jobID string, o interface{}) error

UpdateJob updates the status of a job

func (*Datastore) UpdateJobLog

func (d *Datastore) UpdateJobLog(ctx context.Context, log *api.JobLog) error

UpdateJobLog updates the specified job log

func (*Datastore) UpdateWorkerInfo

func (d *Datastore) UpdateWorkerInfo(ctx context.Context, w *api.Worker) error

Jump to

Keyboard shortcuts

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