store

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManifestFileStore

func NewManifestFileStore(db *sql.DB) *manifestFileStore

func NewManifestStore

func NewManifestStore(db *sql.DB) *manifestStore

func NewUserInfoStore

func NewUserInfoStore(db *sql.DB) *userInfoStore

func NewUserSettingsStore

func NewUserSettingsStore(db *sql.DB) *userSettingsStore

Types

type Manifest

type Manifest struct {
	Id               int32           `json:"id"`
	NodeId           sql.NullString  `json:"node_id"`
	UserId           string          `json:"user_id"`
	UserName         string          `json:"user_name"`
	OrganizationId   string          `json:"organization_id"`
	OrganizationName string          `json:"organization_name"`
	DatasetId        string          `json:"dataset_id"`
	DatasetName      string          `json:"dataset_name"`
	Status           manifest.Status `json:"status"`
	CreatedAt        time.Time       `json:"created_at"`
	UpdatedAt        time.Time       `json:"updated_at"`
}

type ManifestFile

type ManifestFile struct {
	Id         int32               `json:"id"`
	ManifestId int32               `json:"manifest_id"`
	UploadId   uuid.UUID           `json:"upload_id"`
	SourcePath string              `json:"source_path"`
	TargetPath string              `json:"target_path"`
	TargetName string              `json:"target_name"`
	Status     manifestFile.Status `json:"status"`
	CreatedAt  time.Time           `json:"created_at"`
	UpdatedAt  time.Time           `json:"updated_at"`
}

type ManifestFileParams

type ManifestFileParams struct {
	SourcePath string `json:"source_path"`
	TargetPath string `json:"target_path"`
	TargetName string `json:"target_name"`
	ManifestId int32  `json:"manifest_id"`
}

type ManifestFileStore

type ManifestFileStore interface {
	Get(manifestId int32, limit int32, offset int32) ([]ManifestFile, error)
	GetByStatus(manifestId int32, statusArray []manifestFile.Status, limit int, offset int) ([]ManifestFile, error)
	Add(records []ManifestFileParams) error
	BatchSetStatus(status manifestFile.Status, uploadIds []string) error
	SetStatus(status manifestFile.Status, uploadId string) error
	SyncResponseStatusUpdate(manifestId int32, statusList []manifestFile.FileStatusDTO) error
	SyncResponseStatusUpdate2(manifestId int32, failedFiles []string)
	RemoveFromManifest(manifestId int32, removePath string) error
	ResetStatusForManifest(manifestId int32) error
	GetNumberOfRowsForStatus(manifestId int32, statusArr []manifestFile.Status, invert bool) (int64, error)
	ManifestFilesToChannel(ctx context.Context, manifestId int32, statusArr []manifestFile.Status, walker chan<- ManifestFile)
}

type ManifestParams

type ManifestParams struct {
	UserId           string `json:"user_id"`
	UserName         string `json:"user_name"`
	OrganizationId   string `json:"organization_id"`
	OrganizationName string `json:"organization_name"`
	DatasetId        string `json:"dataset_id"`
	DatasetName      string `json:"dataset_name"`
}

type ManifestStore

type ManifestStore interface {
	Get(id int32) (*Manifest, error)
	GetAll() ([]Manifest, error)
	Add(s ManifestParams) (*Manifest, error)
	Remove(manifestId int32) error
	SetManifestNodeId(manifestId int32, nodeId string) error
}

type NoClientSessionError

type NoClientSessionError struct{}

func (*NoClientSessionError) Error

func (m *NoClientSessionError) Error() string

type UserInfo

type UserInfo struct {
	InnerId          int       `json:"inner_id"`
	Id               string    `json:"id"`
	Name             string    `json:"name"`
	SessionToken     string    `json:"session_token"`
	RefreshToken     string    `json:"refresh_token"`
	TokenExpire      time.Time `json:"token_expire"`
	IdToken          string    `json:"id_token"`
	Profile          string    `json:"profile"'`
	Environment      string    `json:"environment"`
	OrganizationId   string    `json:"organization_id"`
	OrganizationName string    `json:"organization_name"`
	UpdatedAt        time.Time `json:"updated_at"`
}

type UserInfoParams

type UserInfoParams struct {
	Id               string
	Name             string
	SessionToken     string
	RefreshToken     string
	Profile          string
	IdToken          string
	TokenExpire      time.Time
	Environment      string
	OrganizationId   string
	OrganizationName string
}

type UserInfoStore

type UserInfoStore interface {
	CreateNewUserInfo(data UserInfoParams) (*UserInfo, error)
	GetUserInfo(id string, profile string) (*UserInfo, error)
	GetAll() ([]UserInfo, error)
	UpdateTokenForUser(userId string, credentials *pennsieve.APISession) error
	DeleteUserForProfile(profile string) error
}

type UserSettings

type UserSettings struct {
	UserId          string `json:"user_id"`
	Profile         string `json:"profile"`
	UseDatasetId    string `json:"use_dataset_id"`
	UploadSessionId string `json:"upload_session_id"`
}

type UserSettingsParams

type UserSettingsParams struct {
	UserId  string
	Profile string
}

type UserSettingsStore

type UserSettingsStore interface {
	Get() (*UserSettings, error)
	CreateNewUserSettings(data UserSettingsParams) (*UserSettings, error)
	UpdateActiveDataset(datasetId string) error
	Delete() error
}

Jump to

Keyboard shortcuts

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