sys

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadAllFile = func(path string) ([]byte, error) {
		f, err := os.Open(path)
		if err != nil {
			return nil, err
		}
		defer f.Close()
		return ioutil.ReadAll(f)
	}
)

Functions

This section is empty.

Types

type Session

type Session struct {
	S *model.Session
	// contains filtered or unexported fields
}

func NewSession

func NewSession(sys *System, usr *model.User) (*Session, error)

func (*Session) AccessRights

func (s *Session) AccessRights() model.Role

func (*Session) Delete

func (s *Session) Delete(k string)

func (*Session) DeleteAll

func (s *Session) DeleteAll() error

func (*Session) DeleteFile

func (s *Session) DeleteFile(filename string) error

func (*Session) DeleteMemory

func (s *Session) DeleteMemory(k string)

func (*Session) FilePath

func (s *Session) FilePath(filename string) string

func (*Session) Get

func (s *Session) Get(k string, ref interface{}) error

func (*Session) GetMemory

func (s *Session) GetMemory(k string) (interface{}, bool)

func (*Session) GetSessionDir

func (s *Session) GetSessionDir() string

func (*Session) Put

func (s *Session) Put(k string, val interface{})

func (*Session) PutMemory

func (s *Session) PutMemory(k string, val interface{})

func (*Session) UserID

func (s *Session) UserID() string

func (*Session) WriteFile

func (s *Session) WriteFile(filename string, reader io.Reader) error

type System

type System struct {
	TestMode    bool
	AllowHttp   bool
	DB          *storage.DBSet
	DS          *eio.DocumentServiceClient
	EmailSender email.EmailSender
	// contains filtered or unexported fields
}

func NewWithSettings

func NewWithSettings(settingsFile string, initialSettings *model.Settings) (*System, error)

func (*System) Configured

func (me *System) Configured() (bool, error)

func (*System) Export

func (me *System) Export(writer io.Writer, s *Session, entities []portable.EntityType) (portable.ProcessedResults, error)

func (*System) ExportSingle

func (me *System) ExportSingle(writer io.Writer, s *Session, entity portable.EntityType, id ...string) (portable.ProcessedResults, error)

func (*System) GetSession

func (me *System) GetSession(sid string) (*Session, error)

func (*System) GetSettings

func (me *System) GetSettings() *model.Settings

func (*System) Import

func (me *System) Import(reader io.Reader, s *Session, skipExisting bool) (portable.ProcessedResults, error)

func (*System) NewSession

func (me *System) NewSession(usr *model.User) (*Session, error)

func (*System) PutSettings

func (me *System) PutSettings(stngs *model.Settings) error

func (*System) Shutdown

func (me *System) Shutdown()

Directories

Path Synopsis
This package simplifies file IO and handles the file path when using JSON or MSGPACK.
This package simplifies file IO and handles the file path when using JSON or MSGPACK.

Jump to

Keyboard shortcuts

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