You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

appstate.go 562B

123456789101112131415161718192021222324
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package system
  4. // StateStore is the interface to get/set app state items
  5. type StateStore interface {
  6. Get(item StateItem) error
  7. Set(item StateItem) error
  8. }
  9. // StateItem provides the name for a state item. the name will be used to generate filenames, etc
  10. type StateItem interface {
  11. Name() string
  12. }
  13. // AppState contains the state items for the app
  14. var AppState StateStore
  15. // Init initialize AppState interface
  16. func Init() error {
  17. AppState = &DBStore{}
  18. return nil
  19. }