Documentation
¶
Index ¶
- func AddAccess(db *sql.DB, ctx context.Context, a *forge.Access) error
- func AddDefault(db *sql.DB, ctx context.Context, d *forge.Default) error
- func AddEntry(db *sql.DB, ctx context.Context, e *forge.Entry) error
- func AddEntryType(db *sql.DB, ctx context.Context, name string) error
- func AddEnviron(db *sql.DB, ctx context.Context, e *forge.Property) error
- func AddGlobal(db *sql.DB, ctx context.Context, g *forge.Global) error
- func AddGroup(db *sql.DB, ctx context.Context, g *forge.Group) error
- func AddGroupMember(db *sql.DB, ctx context.Context, m *forge.Member) error
- func AddThumbnail(db *sql.DB, ctx context.Context, thumb *forge.Thumbnail) error
- func AddUser(db *sql.DB, ctx context.Context, u *forge.User) error
- func AddUserDataSection(db *sql.DB, ctx context.Context, user, section string) error
- func ArchiveEntry(db *sql.DB, ctx context.Context, path string) error
- func CountAllSubEntries(db *sql.DB, ctx context.Context, path string) (int, error)
- func DeleteAccess(db *sql.DB, ctx context.Context, path, name string) error
- func DeleteDefault(db *sql.DB, ctx context.Context, entryType, ctg, name string) error
- func DeleteEntry(db *sql.DB, ctx context.Context, path string) error
- func DeleteEntryRecursive(db *sql.DB, ctx context.Context, path string) error
- func DeleteEntryType(db *sql.DB, ctx context.Context, name string) error
- func DeleteEnviron(db *sql.DB, ctx context.Context, path, name string) error
- func DeleteGlobal(db *sql.DB, ctx context.Context, entryType, name string) error
- func DeleteGroupMember(db *sql.DB, ctx context.Context, group, member string) error
- func DeleteThumbnail(db *sql.DB, ctx context.Context, path string) error
- func DeleteUserData(db *sql.DB, ctx context.Context, user, section, key string) error
- func DeleteUserDataSection(db *sql.DB, ctx context.Context, user, section string) error
- func EntryAccessList(db *sql.DB, ctx context.Context, path string) ([]*forge.Access, error)
- func EntryEnvirons(db *sql.DB, ctx context.Context, path string) ([]*forge.Property, error)
- func EntryProperties(db *sql.DB, ctx context.Context, path string) ([]*forge.Property, error)
- func FindBaseEntryTypes(db *sql.DB, ctx context.Context) ([]string, error)
- func FindDefaults(db *sql.DB, ctx context.Context, find forge.DefaultFinder) ([]*forge.Default, error)
- func FindEntries(db *sql.DB, ctx context.Context, find forge.EntryFinder) ([]*forge.Entry, error)
- func FindEntryTypes(db *sql.DB, ctx context.Context) ([]string, error)
- func FindGlobals(db *sql.DB, ctx context.Context, find forge.GlobalFinder) ([]*forge.Global, error)
- func FindGroupMembers(db *sql.DB, ctx context.Context, find forge.MemberFinder) ([]*forge.Member, error)
- func FindGroups(db *sql.DB, ctx context.Context, find forge.GroupFinder) ([]*forge.Group, error)
- func FindLogs(db *sql.DB, ctx context.Context, find forge.LogFinder) ([]*forge.Log, error)
- func FindOverrideEntryTypes(db *sql.DB, ctx context.Context) ([]string, error)
- func FindThumbnails(db *sql.DB, ctx context.Context, find forge.ThumbnailFinder) ([]*forge.Thumbnail, error)
- func FindUserData(db *sql.DB, ctx context.Context, find forge.UserDataFinder) ([]*forge.UserDataSection, error)
- func FindUserSettings(db *sql.DB, ctx context.Context, find forge.UserSettingFinder) ([]*forge.UserSetting, error)
- func FindUsers(db *sql.DB, ctx context.Context, find forge.UserFinder) ([]*forge.User, error)
- func GetAccess(db *sql.DB, ctx context.Context, path, name string) (*forge.Access, error)
- func GetAccessList(db *sql.DB, ctx context.Context, path string) ([]*forge.Access, error)
- func GetEntry(db *sql.DB, ctx context.Context, path string) (*forge.Entry, error)
- func GetEnviron(db *sql.DB, ctx context.Context, path, name string) (*forge.Property, error)
- func GetEnvirons(db *sql.DB, ctx context.Context, path string) ([]*forge.Property, error)
- func GetGlobal(db *sql.DB, ctx context.Context, entryType, name string) (*forge.Global, error)
- func GetGroup(db *sql.DB, ctx context.Context, name string) (*forge.Group, error)
- func GetLogs(db *sql.DB, ctx context.Context, path, ctg, name string) ([]*forge.Log, error)
- func GetProperty(db *sql.DB, ctx context.Context, path, name string) (*forge.Property, error)
- func GetThumbnail(db *sql.DB, ctx context.Context, path string) (*forge.Thumbnail, error)
- func GetUser(db *sql.DB, ctx context.Context, user string) (*forge.User, error)
- func GetUserData(db *sql.DB, ctx context.Context, user, section, key string) (string, error)
- func GetUserDataSection(db *sql.DB, ctx context.Context, user, section string) (*forge.UserDataSection, error)
- func GetUserSetting(db *sql.DB, ctx context.Context, user string) (*forge.UserSetting, error)
- func Init(db *sql.DB) error
- func IsAdmin(db *sql.DB, ctx context.Context, user string) (bool, error)
- func Open(path string) (*sql.DB, error)
- func RenameEntry(db *sql.DB, ctx context.Context, path, newName string) error
- func RenameEntryType(db *sql.DB, ctx context.Context, name, newName string) error
- func SearchEntries(db *sql.DB, ctx context.Context, search forge.EntrySearcher) ([]*forge.Entry, error)
- func SetUserData(db *sql.DB, ctx context.Context, user, section, key, value string) error
- func UnarchiveEntry(db *sql.DB, ctx context.Context, path string) error
- func UpdateAccess(db *sql.DB, ctx context.Context, upd forge.AccessUpdater) error
- func UpdateDefault(db *sql.DB, ctx context.Context, upd forge.DefaultUpdater) error
- func UpdateEnviron(db *sql.DB, ctx context.Context, upd forge.PropertyUpdater) error
- func UpdateGlobal(db *sql.DB, ctx context.Context, upd forge.GlobalUpdater) error
- func UpdateGroup(db *sql.DB, ctx context.Context, upd forge.GroupUpdater) error
- func UpdateProperties(db *sql.DB, ctx context.Context, upds []forge.PropertyUpdater) error
- func UpdateProperty(db *sql.DB, ctx context.Context, upd forge.PropertyUpdater) error
- func UpdateThumbnail(db *sql.DB, ctx context.Context, upd forge.ThumbnailUpdater) error
- func UpdateUser(db *sql.DB, ctx context.Context, upd forge.UserUpdater) error
- func UpdateUserSetting(db *sql.DB, ctx context.Context, upd forge.UserSettingUpdater) error
- func UserRead(db *sql.DB, ctx context.Context, path string) error
- func UserWrite(db *sql.DB, ctx context.Context, path string) error
- type Service
- func (s Service) AddAccess(ctx context.Context, a *forge.Access) error
- func (s *Service) AddDefault(ctx context.Context, d *forge.Default) error
- func (s *Service) AddEntry(ctx context.Context, ent *forge.Entry) error
- func (s *Service) AddEntryType(ctx context.Context, name string) error
- func (s *Service) AddEnviron(ctx context.Context, ent *forge.Property) error
- func (s *Service) AddGlobal(ctx context.Context, d *forge.Global) error
- func (s *Service) AddGroup(ctx context.Context, g *forge.Group) error
- func (s *Service) AddGroupMember(ctx context.Context, m *forge.Member) error
- func (s *Service) AddThumbnail(ctx context.Context, thumb *forge.Thumbnail) error
- func (s *Service) AddUser(ctx context.Context, u *forge.User) error
- func (s *Service) AddUserDataSection(ctx context.Context, user, section string) error
- func (s *Service) ArchiveEntry(ctx context.Context, path string) error
- func (s *Service) CountAllSubEntries(ctx context.Context, path string) (int, error)
- func (s *Service) DeleteAccess(ctx context.Context, path, name string) error
- func (s *Service) DeleteDefault(ctx context.Context, entType, ctg, name string) error
- func (s *Service) DeleteEntry(ctx context.Context, path string) error
- func (s *Service) DeleteEntryRecursive(ctx context.Context, path string) error
- func (s *Service) DeleteEntryType(ctx context.Context, name string) error
- func (s *Service) DeleteEnviron(ctx context.Context, path, name string) error
- func (s *Service) DeleteGlobal(ctx context.Context, entType, name string) error
- func (s *Service) DeleteGroupMember(ctx context.Context, group, member string) error
- func (s *Service) DeleteThumbnail(ctx context.Context, path string) error
- func (s *Service) DeleteUserData(ctx context.Context, user, section, key string) error
- func (s *Service) DeleteUserDataSection(ctx context.Context, user, section string) error
- func (s Service) EntryAccessList(ctx context.Context, path string) ([]*forge.Access, error)
- func (s *Service) EntryEnvirons(ctx context.Context, path string) ([]*forge.Property, error)
- func (s *Service) EntryProperties(ctx context.Context, path string) ([]*forge.Property, error)
- func (s *Service) FindBaseEntryTypes(ctx context.Context) ([]string, error)
- func (s *Service) FindDefaults(ctx context.Context, find forge.DefaultFinder) ([]*forge.Default, error)
- func (s *Service) FindEntries(ctx context.Context, find forge.EntryFinder) ([]*forge.Entry, error)
- func (s *Service) FindEntryTypes(ctx context.Context) ([]string, error)
- func (s *Service) FindGlobals(ctx context.Context, find forge.GlobalFinder) ([]*forge.Global, error)
- func (s *Service) FindGroupMembers(ctx context.Context, find forge.MemberFinder) ([]*forge.Member, error)
- func (s *Service) FindGroups(ctx context.Context, find forge.GroupFinder) ([]*forge.Group, error)
- func (s *Service) FindLogs(ctx context.Context, find forge.LogFinder) ([]*forge.Log, error)
- func (s *Service) FindOverrideEntryTypes(ctx context.Context) ([]string, error)
- func (s *Service) FindUserData(ctx context.Context, find forge.UserDataFinder) ([]*forge.UserDataSection, error)
- func (s *Service) FindUsers(ctx context.Context, find forge.UserFinder) ([]*forge.User, error)
- func (s *Service) GetAccess(ctx context.Context, path, name string) (*forge.Access, error)
- func (s Service) GetAccessList(ctx context.Context, path string) ([]*forge.Access, error)
- func (s *Service) GetEntry(ctx context.Context, path string) (*forge.Entry, error)
- func (s *Service) GetEnviron(ctx context.Context, path, name string) (*forge.Property, error)
- func (s *Service) GetEnvirons(ctx context.Context, path string) ([]*forge.Property, error)
- func (s *Service) GetGlobal(ctx context.Context, entType, name string) (*forge.Global, error)
- func (s *Service) GetLogs(ctx context.Context, path, ctg, name string) ([]*forge.Log, error)
- func (s *Service) GetProperty(ctx context.Context, path, name string) (*forge.Property, error)
- func (s *Service) GetThumbnail(ctx context.Context, path string) (*forge.Thumbnail, error)
- func (s *Service) GetUser(ctx context.Context, user string) (*forge.User, error)
- func (s *Service) GetUserData(ctx context.Context, user, section, key string) (string, error)
- func (s *Service) GetUserDataSection(ctx context.Context, user, section string) (*forge.UserDataSection, error)
- func (s *Service) GetUserSetting(ctx context.Context, user string) (*forge.UserSetting, error)
- func (s *Service) IsAdmin(ctx context.Context, user string) (bool, error)
- func (s *Service) RenameEntry(ctx context.Context, path, newName string) error
- func (s *Service) RenameEntryType(ctx context.Context, name, newName string) error
- func (s *Service) SearchEntries(ctx context.Context, search forge.EntrySearcher) ([]*forge.Entry, error)
- func (s *Service) SetUserData(ctx context.Context, user, section, key, value string) error
- func (s *Service) UnarchiveEntry(ctx context.Context, path string) error
- func (s Service) UpdateAccess(ctx context.Context, upd forge.AccessUpdater) error
- func (s *Service) UpdateDefault(ctx context.Context, upd forge.DefaultUpdater) error
- func (s *Service) UpdateEnviron(ctx context.Context, upd forge.PropertyUpdater) error
- func (s *Service) UpdateGlobal(ctx context.Context, upd forge.GlobalUpdater) error
- func (s *Service) UpdateGroup(ctx context.Context, upd forge.GroupUpdater) error
- func (s *Service) UpdateProperties(ctx context.Context, upds []forge.PropertyUpdater) error
- func (s *Service) UpdateProperty(ctx context.Context, upd forge.PropertyUpdater) error
- func (s *Service) UpdateThumbnail(ctx context.Context, upd forge.ThumbnailUpdater) error
- func (s *Service) UpdateUser(ctx context.Context, upd forge.UserUpdater) error
- func (s *Service) UpdateUserSetting(ctx context.Context, upd forge.UserSettingUpdater) error
- func (s *Service) UserRead(ctx context.Context, path string) error
- func (s *Service) UserWrite(ctx context.Context, path string) error
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddThumbnail ¶
func AddUserDataSection ¶
func CountAllSubEntries ¶
func DeleteDefault ¶
func DeleteEntryRecursive ¶
func DeleteGlobal ¶
func DeleteGroupMember ¶
func DeleteUserData ¶
DeleteUserData deletes a user data from the sql file. NOTE: It will not return an error even the user data wasn't existed. The user should check it explicitly, if needed.
func DeleteUserDataSection ¶
func EntryAccessList ¶
func EntryEnvirons ¶
func EntryProperties ¶
func FindBaseEntryTypes ¶
func FindDefaults ¶
func FindEntries ¶
func FindEntryTypes ¶
TODO: it should get EntryTypeFinder as an argument.
func FindGlobals ¶
func FindGroupMembers ¶
func FindGroups ¶
func FindOverrideEntryTypes ¶
func FindThumbnails ¶
func FindUserData ¶
func FindUserData(db *sql.DB, ctx context.Context, find forge.UserDataFinder) ([]*forge.UserDataSection, error)
func FindUserSettings ¶
func FindUserSettings(db *sql.DB, ctx context.Context, find forge.UserSettingFinder) ([]*forge.UserSetting, error)
func GetAccessList ¶
func GetEnviron ¶
func GetEnvirons ¶
GetEnvirons get environs defined in an entry. It doesn't count inherited environs unlike EntryEnvirons.
func GetProperty ¶
func GetThumbnail ¶
func GetUserData ¶
GetUserData returns a user data from the sql file. NOTE: It doesn't raise error even if the key (even the section) doesn't exists in user_data table. It returns an empty string, instead.
func GetUserDataSection ¶
func GetUserSetting ¶
func RenameEntryType ¶
func SearchEntries ¶
func SetUserData ¶
SetUserData sets a user data to the sql file. It adds if the user data is not exists. It will update the value instead, if the user data is already exists.
func UpdateAccess ¶
func UpdateDefault ¶
func UpdateEnviron ¶
func UpdateGlobal ¶
func UpdateGroup ¶
func UpdateProperties ¶
UpdateProperties is an efficient way of update properties of an entry, by group them in a transaction. If there's an error, all changes will be reverted.
func UpdateProperty ¶
func UpdateThumbnail ¶
func UpdateUser ¶
func UpdateUserSetting ¶
func UserRead ¶
UserRead simulates the context user read the path. It returns nil if the path exists and the user can read the path. It returns forge.NotFound error if the path is not exists or the context user doesn't have read permission.
func UserWrite ¶
UserWrite simulates the context user write to the path. It returns nil if the path exists and the user can write to the path. It returns forge.NotFound error if the path is not exists or the context user doesn't have read permission. It returns forge.Unauthorized error when the user doesn't have write permission.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) AddDefault ¶
func (*Service) AddEntryType ¶
func (*Service) AddEnviron ¶
func (*Service) AddGroupMember ¶
func (*Service) AddThumbnail ¶
func (*Service) AddUserDataSection ¶
func (*Service) ArchiveEntry ¶
func (*Service) CountAllSubEntries ¶
func (*Service) DeleteAccess ¶
func (*Service) DeleteDefault ¶
func (*Service) DeleteEntryRecursive ¶
func (*Service) DeleteEntryType ¶
func (*Service) DeleteEnviron ¶
func (*Service) DeleteGlobal ¶
func (*Service) DeleteGroupMember ¶
func (*Service) DeleteThumbnail ¶
func (*Service) DeleteUserData ¶
func (*Service) DeleteUserDataSection ¶
func (Service) EntryAccessList ¶
func (*Service) EntryEnvirons ¶
func (*Service) EntryProperties ¶
func (*Service) FindBaseEntryTypes ¶
func (*Service) FindDefaults ¶
func (*Service) FindEntries ¶
func (*Service) FindEntryTypes ¶
func (*Service) FindGlobals ¶
func (*Service) FindGroupMembers ¶
func (*Service) FindGroups ¶
func (*Service) FindOverrideEntryTypes ¶
func (*Service) FindUserData ¶
func (s *Service) FindUserData(ctx context.Context, find forge.UserDataFinder) ([]*forge.UserDataSection, error)