models

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest added in v0.1.2

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"`
}

func (*Manifest) Add added in v0.1.2

func (m *Manifest) Add(s ManifestParams) (*Manifest, error)

Add adds multiple rows to the UploadRecords database.

func (*Manifest) Get added in v0.1.2

func (*Manifest) Get(id int32) (*Manifest, error)

Get returns all rows in the Upload Record Table

func (*Manifest) GetAll added in v0.1.2

func (*Manifest) GetAll() ([]Manifest, error)

GetAll returns all rows in the Upload Record Table

func (*Manifest) Remove added in v0.1.2

func (*Manifest) Remove(manifestId int32) error

Remove removes a manifest from the local DB.

func (*Manifest) SetManifestNodeId added in v0.2.0

func (m *Manifest) SetManifestNodeId(nodeId string) error

type ManifestFile added in v0.1.2

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"`
}

func (*ManifestFile) Add added in v0.1.2

func (*ManifestFile) Add(records []ManifestFileParams) error

Add adds multiple rows to the UploadRecords database.

func (*ManifestFile) Get added in v0.1.2

func (*ManifestFile) Get(manifestId int32, limit int32, offset int32) ([]ManifestFile, error)

Get returns manifest paginated manifest files.

func (*ManifestFile) GetAll added in v0.1.2

func (*ManifestFile) GetAll() ([]ManifestFile, error)

GetAll returns all rows in the Upload Record Table

func (*ManifestFile) GetByStatus added in v0.2.0

func (*ManifestFile) GetByStatus(manifestId int32, statusArray []manifestFile.Status, limit int, offset int) ([]ManifestFile, error)

GetByStatus returns files in a manifest filtered by status.

func (*ManifestFile) RemoveFromManifest added in v0.2.0

func (*ManifestFile) RemoveFromManifest(manifestId int32, removePath string) error

RemoveFromManifest removes files from local manifest by path.

func (*ManifestFile) ReplacePath added in v0.2.0

func (*ManifestFile) ReplacePath(manifestId int32, path string, replacePath string, fileIds []int32)

ReplacePath allows users to replace the target path with another path.

func (*ManifestFile) ResetStatusForManifest added in v0.2.0

func (*ManifestFile) ResetStatusForManifest(manifestId int32) error

func (*ManifestFile) SyncResponseStatusUpdate added in v0.2.0

func (*ManifestFile) SyncResponseStatusUpdate(manifestId int32, statusList []manifestFile.FileStatusDTO) error

func (*ManifestFile) SyncResponseStatusUpdate2 added in v0.2.0

func (*ManifestFile) SyncResponseStatusUpdate2(manifestId int32, failedFiles []string)

SyncResponseStatusUpdate2 updates local DB based on successful/unsuccessful updates remotely. 1. Set to SYNCED for all files that were successfully synchronized (Initiated, Failed) 2. Remove files with REMOVED that were successfully removed remotely.

type ManifestFileParams added in v0.1.2

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

type ManifestParams added in v0.1.2

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 NoClientSessionError added in v0.1.0

type NoClientSessionError struct{}

func (*NoClientSessionError) Error added in v0.1.0

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"`
}

func CreateNewUserInfo added in v0.0.5

func CreateNewUserInfo(data UserInfoParams) (*UserInfo, error)

func GetUserInfo added in v0.0.5

func GetUserInfo(id string, profile string) (*UserInfo, error)

func UpdateTokenForUser added in v0.0.5

func UpdateTokenForUser(user *UserInfo, credentials *pennsieve.APISession) (*UserInfo, error)

func (*UserInfo) GetAll

func (user *UserInfo) GetAll() ([]UserInfo, error)

type UserInfoParams

type UserInfoParams struct {
	Id           string
	Name         string
	SessionToken string
	RefreshToken string
	Profile      string
	IdToken      string

	Environment      string
	OrganizationId   string
	OrganizationName string
	// contains filtered or unexported fields
}

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"`
}

func CreateNewUserSettings added in v0.0.5

func CreateNewUserSettings(data UserSettingsParams) (*UserSettings, error)

CreateNewUserSettings creates or replaces existing user-settings row in db.

func (*UserSettings) Get added in v0.1.0

func (*UserSettings) Get() (*UserSettings, error)

Get returns the UserSettings object or nil if no user-settings are defined.

func (*UserSettings) UpdateActiveDataset added in v0.1.0

func (*UserSettings) UpdateActiveDataset(datasetId string) error

type UserSettingsParams added in v0.0.5

type UserSettingsParams struct {
	UserId  string
	Profile string
}

Jump to

Keyboard shortcuts

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