datastore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 21 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.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAccountExists is returned if an account already exists
	ErrAccountExists = errors.New("an account with that username already exists")
	// 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")
)
View Source
var (
	// ErrNamespaceDoesNotExist is returned when an namespace cannot be found
	ErrNamespaceDoesNotExist = errors.New("namespace does not exist")
)

Functions

This section is empty.

Types

type ByWorkflowCreatedAt

type ByWorkflowCreatedAt []*api.Workflow

func (ByWorkflowCreatedAt) Len

func (s ByWorkflowCreatedAt) Len() int

func (ByWorkflowCreatedAt) Less

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

func (ByWorkflowCreatedAt) Swap

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

type Datastore

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

func NewDatastore

func NewDatastore(cfg *flow.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) CreateAccount

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

func (*Datastore) CreateNamespace

func (d *Datastore) CreateNamespace(ctx context.Context, namespace *api.Namespace) (string, error)

func (*Datastore) DeleteAccount

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

func (*Datastore) DeleteNamespace

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

func (*Datastore) DeleteWorkflow

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

func (*Datastore) GetAccount

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

func (*Datastore) GetAccountByID

func (d *Datastore) GetAccountByID(ctx context.Context, id 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) GetAuthenticatorKeys

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

func (*Datastore) GetCacheObject

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

func (*Datastore) GetNamespace

func (d *Datastore) GetNamespace(ctx context.Context, id string) (*api.Namespace, error)

func (*Datastore) GetNamespaces

func (d *Datastore) GetNamespaces(ctx context.Context) ([]*api.Namespace, error)

func (*Datastore) GetWorkflow

func (d *Datastore) GetWorkflow(ctx context.Context, id string) (*api.Workflow, error)

func (*Datastore) GetWorkflows

func (d *Datastore) GetWorkflows(ctx context.Context) ([]*api.Workflow, error)

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) UpdateNamespace

func (d *Datastore) UpdateNamespace(ctx context.Context, namespace *api.Namespace) error

func (*Datastore) UpdateWorkflow

func (d *Datastore) UpdateWorkflow(ctx context.Context, workflow *api.Workflow) error

Jump to

Keyboard shortcuts

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