cabriui

package
v0.0.0-...-aa4546b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIRun

func CLIRun[OT BaseOptionsEr, VT baseVarsEr](
	cliIn io.Reader, cliOut io.Writer, cliErr io.Writer,
	opts OT, args []string,
	startup func(cr *joule.CLIRunner[OT]) error,
	shutdown func(cr *joule.CLIRunner[OT]) error,
) error

func CheckDssPath

func CheckDssPath(dssPath string) (dssType, root, npath string, err error)

func CheckDssSpec

func CheckDssSpec(dssSpec string) (dssType, root string, err error)

func CheckDssUrlMapping

func CheckDssUrlMapping(dum string) (dssType, addr, localPath, root string, isTls bool, err error)

func CheckResol

func CheckResol(resol string) error

func CheckTimeStamp

func CheckTimeStamp(value string) (int64, error)

func CheckUiACL

func CheckUiACL(sacl []string) ([]cabridss.ACLEntry, error)

func ConfigDir

func ConfigDir(opts BaseOptions) (string, error)

func ConfigShutdown

func ConfigShutdown(cr *joule.CLIRunner[ConfigOptions]) error

func ConfigStartup

func ConfigStartup(cr *joule.CLIRunner[ConfigOptions]) error

func DSSAuditShutdown

func DSSAuditShutdown(cr *joule.CLIRunner[DSSAuditOptions]) error

func DSSAuditStartup

func DSSAuditStartup(cr *joule.CLIRunner[DSSAuditOptions]) error

func DSSCleanShutdown

func DSSCleanShutdown(cr *joule.CLIRunner[DSSCleanOptions]) error

func DSSCleanStartup

func DSSCleanStartup(cr *joule.CLIRunner[DSSCleanOptions]) error

func DSSConfigShutdown

func DSSConfigShutdown(cr *joule.CLIRunner[DSSConfigOptions]) error

func DSSConfigStartup

func DSSConfigStartup(cr *joule.CLIRunner[DSSConfigOptions]) error

func DSSGetPutShutdown

func DSSGetPutShutdown(cr *joule.CLIRunner[DSSGetPutOptions]) error

func DSSGetPutStartup

func DSSGetPutStartup(cr *joule.CLIRunner[DSSGetPutOptions]) error

func DSSLsHistoShutdown

func DSSLsHistoShutdown(cr *joule.CLIRunner[DSSLsHistoOptions]) error

func DSSLsHistoStartup

func DSSLsHistoStartup(cr *joule.CLIRunner[DSSLsHistoOptions]) error

func DSSMkShutdown

func DSSMkShutdown(cr *joule.CLIRunner[DSSMkOptions]) error

func DSSMkStartup

func DSSMkStartup(cr *joule.CLIRunner[DSSMkOptions]) error

func DSSMknsShutdown

func DSSMknsShutdown(cr *joule.CLIRunner[DSSMknsOptions]) error

func DSSMknsStartup

func DSSMknsStartup(cr *joule.CLIRunner[DSSMknsOptions]) error

func DSSReindexShutdown

func DSSReindexShutdown(cr *joule.CLIRunner[DSSReindexOptions]) error

func DSSReindexStartup

func DSSReindexStartup(cr *joule.CLIRunner[DSSReindexOptions]) error

func DSSRmHistoShutdown

func DSSRmHistoShutdown(cr *joule.CLIRunner[DSSRmHistoOptions]) error

func DSSRmHistoStartup

func DSSRmHistoStartup(cr *joule.CLIRunner[DSSRmHistoOptions]) error

func DSSScanShutdown

func DSSScanShutdown(cr *joule.CLIRunner[DSSScanOptions]) error

func DSSScanStartup

func DSSScanStartup(cr *joule.CLIRunner[DSSScanOptions]) error

func DSSUnlockShutdown

func DSSUnlockShutdown(cr *joule.CLIRunner[DSSUnlockOptions]) error

func DSSUnlockStartup

func DSSUnlockStartup(cr *joule.CLIRunner[DSSUnlockOptions]) error

func GetBaseConfig

func GetBaseConfig(opts BaseOptions, index int, root, localPath, mp string) (cabridss.DssBaseConfig, error)

func GetObsConfig

func GetObsConfig(opts BaseOptions, index int, root, mp string) (cabridss.ObsConfig, error)

func GetOlfConfig

func GetOlfConfig(opts BaseOptions, index int, root, mp string) (cabridss.OlfConfig, error)

func GetS3Config

func GetS3Config(opts BaseOptions, index int) cabridss.ObsConfig

func GetSmfConfig

func GetSmfConfig(opts BaseOptions, index int, root, mp string) (cabridss.ObsConfig, error)

func GetWebConfig

func GetWebConfig(opts BaseOptions, index int, isTls bool, addr, root string, ure UiRunEnv) (cabridss.WebDssConfig, error)

func GetWfsConfig

func GetWfsConfig(opts BaseOptions, index int, isTls bool, addr, root string, ure UiRunEnv) (cabridss.WfsDssConfig, error)

func HPassword

func HPassword(uow joule.UnitOfWork, opts BaseOptions) (string, error)

func LsnsShutdown

func LsnsShutdown(cr *joule.CLIRunner[LsnsOptions]) error

func LsnsStartup

func LsnsStartup(cr *joule.CLIRunner[LsnsOptions]) error

func MasterPassword

func MasterPassword(uow joule.UnitOfWork, opts BaseOptions, askNumber int) (string, error)

func MutualExcludeFlags

func MutualExcludeFlags(names []string, flags ...bool) (string, error)

func NewHDss

func NewHDss[OT BaseOptionsEr, VT baseVarsEr](
	ctx context.Context, setCfgFunc func(bc *cabridss.DssBaseConfig), nhArgs NewHDssArgs,
) (cabridss.HDss, error)

func NewServerErr

func NewServerErr(where string, err error) error

func NewWfsDss

func NewWfsDss[OT BaseOptionsEr, VT baseVarsEr](
	ctx context.Context, setCfgFunc func(bc *cabridss.DssBaseConfig), nhArgs NewHDssArgs,
) (cabridss.Dss, error)

func NewXobsDss

func NewXobsDss(opts BaseOptions, setCfgFunc func(bc *cabridss.DssBaseConfig), index int, lasttime int64, root, mp string, isSmf bool, aclusers []string) (cabridss.HDss, error)

func NewXolfDss

func NewXolfDss(opts BaseOptions, setCfgFunc func(bc *cabridss.DssBaseConfig), index int, lasttime int64, root, mp string, aclusers []string) (cabridss.HDss, error)

func S3ToolsShutdown

func S3ToolsShutdown(cr *joule.CLIRunner[S3ToolsOptions]) error

func S3ToolsStartup

func S3ToolsStartup(cr *joule.CLIRunner[S3ToolsOptions]) error

func SampleShutdown

func SampleShutdown(cr *joule.CLIRunner[SampleOptions]) error

func SampleStartup

func SampleStartup(cr *joule.CLIRunner[SampleOptions]) error

func SchedServerConfigurator

func SchedServerConfigurator(e *echo.Echo, root string, configs map[string]interface{}) error

func Schedule

func Schedule(sc *ScheduleConfig) (time.Duration, error)

func ScheduleShutdown

func ScheduleShutdown(cr *joule.CLIRunner[ScheduleOptions]) error

func ScheduleStartup

func ScheduleStartup(cr *joule.CLIRunner[ScheduleOptions]) error

func SyncShutdown

func SyncShutdown(cr *joule.CLIRunner[SyncOptions]) error

func SyncStartup

func SyncStartup(cr *joule.CLIRunner[SyncOptions]) error

func WebApiShutdown

func WebApiShutdown(cr *joule.CLIRunner[WebApiOptions]) error

func WebApiStartup

func WebApiStartup(cr *joule.CLIRunner[WebApiOptions]) error

Types

type BaseOptions

type BaseOptions struct {
	ConfigDir     string
	Users         []string
	ACL           []string
	Password      bool
	PassFile      string
	Serial        bool
	MaxThread     int // set the maximum OS thread number
	RedLimit      int // set the reducer I/O limit defaults to 8
	IndexImplems  []string
	ObsRegions    []string
	ObsEndpoints  []string
	ObsContainers []string
	ObsAccessKeys []string
	ObsSecretKeys []string
	TlsCert       string // certificate file on https server or untrusted CA on https client
	TlsNoCheck    bool   // no check of certificate by https client
	HUser         string // https client basic auth user
	HPassword     bool   // https client basic auth password
	HPFile        string // https client basic auth password
	// Left entities located here in case of sync CLI for convenience
	LeftUsers []string
	LeftACL   []string
}

type BaseOptionsEr

type BaseOptionsEr interface {
	// contains filtered or unexported methods
}

type CabriScheduleSpec

type CabriScheduleSpec map[string]struct {
	Period          int                `yaml:"period"` // periodicity of action, if <= 0 no periodic action
	ContinueOnError bool               `yaml:"continueOnError"`
	ExitOnError     bool               `yaml:"exitOnError"`
	Actions         []SScheduledAction `yaml:"actions"`
}

type ConfigOptions

type ConfigOptions struct {
	BaseOptions
	Encrypt bool
	Decrypt bool
	Dump    bool
	Gen     bool
	Get     bool
	Put     bool
	Remove  bool
}

type ConfigVars

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

type DSSAuditOptions

type DSSAuditOptions struct {
	BaseOptions
}

type DSSAuditVars

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

type DSSCleanOptions

type DSSCleanOptions struct {
	BaseOptions
}

type DSSCleanVars

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

type DSSConfigOptions

type DSSConfigOptions struct {
	BaseOptions
	Raw bool
}

type DSSConfigVars

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

type DSSGetPutOptions

type DSSGetPutOptions struct {
	BaseOptions
}

type DSSGetPutVars

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

type DSSLsHistoOptions

type DSSLsHistoOptions struct {
	BaseOptions
	Recursive  bool
	Sorted     bool
	Resolution string
}

type DSSLsHistoVars

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

type DSSMkOptions

type DSSMkOptions struct {
	BaseOptions
	Size string
}

type DSSMkVars

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

type DSSMknsOptions

type DSSMknsOptions struct {
	BaseOptions
	Children []string
}

type DSSMknsVars

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

type DSSReindexOptions

type DSSReindexOptions struct {
	BaseOptions
}

type DSSReindexVars

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

type DSSRmHistoOptions

type DSSRmHistoOptions struct {
	BaseOptions
	Recursive bool
	DryRun    bool
	StartTime string
	EndTime   string
}

type DSSRmHistoVars

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

type DSSScanOptions

type DSSScanOptions struct {
	BaseOptions
	Checksum    bool
	Purge       bool
	PurgeHidden bool
	Summary     bool
	Full        bool
	Resolution  string
}

type DSSScanVars

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

type DSSUnlockOptions

type DSSUnlockOptions struct {
	BaseOptions
	RepairIndex    bool
	RepairReadOnly bool
	LockForTest    bool
}

type DSSUnlockVars

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

type LsnsOptions

type LsnsOptions struct {
	BaseOptions
	Recursive bool
	Sorted    bool
	Time      bool
	Long      bool
	Checksum  bool
	Reverse   bool
	LastTime  string
}

type LsnsVars

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

type NewHDssArgs

type NewHDssArgs struct {
	Lasttime  int64
	DssIx     int
	ObsIx     int
	IsMapping bool
}

type S3ToolsOptions

type S3ToolsOptions struct {
	BaseOptions
	S3Session bool
	S3List    bool
	S3Purge   bool
	S3Clone   bool
	S3AsOlf   bool
	S3Put     bool
	S3Get     bool
	S3Rename  bool
	S3Delete  bool
}

type S3ToolsVars

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

type SCabriSyncSpec

type SCabriSyncSpec struct {
	SScheduleBase `yaml:"base"`
	LeftUsers     []string `yaml:"leftUsers"`
	LeftACL       []string `yaml:"leftACL"`
	RightUsers    []string `yaml:"rightUsers"`
	RightACL      []string `yaml:"rightACL"`
	Recursive     bool     `yaml:"recursive"`
	DryRun        bool     `yaml:"dryRun"`
	BiDir         bool     `yaml:"biDir"`
	KeepContent   bool     `yaml:"keepContent"`
	NoCh          bool     `yaml:"noCh"`
	NoACL         bool     `yaml:"noACL"`
	MapACL        []string `yaml:"mapACL"`
	Summary       bool     `yaml:"summary"`
	Verbose       bool     `yaml:"verbose"`
	VerboseLevel  int      `yaml:"verboseLevel"`
	LeftTime      string   `yaml:"leftTime"`
	RightTime     string   `yaml:"rightTime"`
	LeftDss       string   `yaml:"leftDss"`
	RightDss      string   `yaml:"rightDss"`
}

type SGitSpec

type SGitSpec struct {
	SScheduleBase   `yaml:"base"`
	RepoUrl         string `yaml:"repoUrl"`
	ClonePath       string `yaml:"clonePath"`
	CloneOptions    string `yaml:"cloneOptions"`
	Branch          string `yaml:"branch"`
	CheckOutOptions string `yaml:"checkOutOptions"`
	PullOptions     string `yaml:"pullOptions"`
}

type SScheduleBase

type SScheduleBase struct {
	Verbose bool `yaml:"verbose"`
	DispOut bool `yaml:"dispOut"`
	DispErr bool `yaml:"dispErr"`
}

type SScheduledAction

type SScheduledAction struct {
	SScheduleBase `yaml:"base"`
	Type          string         `yaml:"type"` // currently "cabriSync", "git" or "cmd"
	CabriSyncSpec SCabriSyncSpec `yaml:"cabriSyncSpec"`
	GitSpec       SGitSpec       `yaml:"gitSpec"`
	CmdLine       string         `yaml:"cmdLine"`
}

func (SScheduledAction) String

func (ssa SScheduledAction) String() string

type SampleOptions

type SampleOptions struct {
	BaseOptions
	FlagSample bool
}

type SampleVars

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

type ScheduleConfig

type ScheduleConfig struct {
	Spec CabriScheduleSpec
	// contains filtered or unexported fields
}

type ScheduleOptions

type ScheduleOptions struct {
	BaseOptions
	HasLog   bool
	SpecFile string
	HasHttp  bool
	Address  string
}

type ScheduleRunStatus

type ScheduleRunStatus struct {
	IsRunning bool `json:"isRunning"`

	Count     int    `json:"count"`
	LastTime  int64  `json:"lastTime"`
	LastOut   string `json:"lastOut"`
	LastErr   string `json:"lastErr"`
	LastRunOk bool   `json:"lastRunOk"`
	// contains filtered or unexported fields
}

type ScheduleVars

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

type SyncOptions

type SyncOptions struct {
	BaseOptions
	Recursive    bool
	DryRun       bool
	BiDir        bool
	KeepContent  bool
	NoCh         bool
	NoACL        bool
	MapACL       []string
	Summary      bool
	Verbose      bool
	VerboseLevel int
	LeftTime     string
	RightTime    string
}

type SyncVars

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

type UiRunEnv

type UiRunEnv struct {
	Encrypted         bool
	MasterPassword    string
	ConfigDir         string
	UserConfig        cabridss.UserConfig
	UiUsers           []string
	UiACL             []cabridss.ACLEntry
	DefaultSyncUser   string // only used for synchro: OS uid for fsy DSS, empty otherwise
	BasicAuthUser     string
	BasicAuthPassword string
}

func GetUiRunEnv

func GetUiRunEnv[OT BaseOptionsEr, VT baseVarsEr](ctx context.Context, encrypted, isLeft bool) (ure UiRunEnv, err error)

func (UiRunEnv) ACLOrDefault

func (ure UiRunEnv) ACLOrDefault() ([]cabridss.ACLEntry, error)

func (UiRunEnv) GetACL

func (ure UiRunEnv) GetACL() []cabridss.ACLEntry

func (UiRunEnv) GetUsers

func (ure UiRunEnv) GetUsers() ([]string, error)

type WebApiOptions

type WebApiOptions struct {
	BaseOptions
	HasLog        bool
	IsRest        bool
	TlsKey        string // certificate key file on https server
	LastTime      string
	TlsClientCert string // untrusted CA on https client
}

type WebApiVars

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

Jump to

Keyboard shortcuts

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