models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 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.ManifestStatus `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.

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"`
	Status     ManifestFileStatus `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)

func (*ManifestFile) GetAll added in v0.1.2

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

GetAll returns all rows in the Upload Record Table

type ManifestFileParams added in v0.1.2

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

type ManifestFileStatus added in v0.1.2

type ManifestFileStatus int64
const (
	FileRegistered ManifestFileStatus = iota
	FileSynced
	FileUploading
	FileCompleted
	FileVerified
	FileCancelled
)

func (ManifestFileStatus) ManifestFileStatusMap added in v0.1.2

func (s ManifestFileStatus) ManifestFileStatusMap(value string) ManifestFileStatus

func (ManifestFileStatus) String added in v0.1.2

func (s ManifestFileStatus) String() string

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