frontend.go 656 B

123456789101112131415161718
  1. package ui
  2. // ReturnInterface is returned by the Intercom interface when a method is called
  3. type ReturnInterface interface {
  4. Get(i int) (interface{}, error)
  5. Size() int
  6. }
  7. // Frontend is the basic interface for calling arbitrary methods on something that
  8. // implements a front end (GUI, CLI, etc)
  9. type Frontend interface {
  10. // Checks whether a specific method is implemented
  11. Supports(method string) bool
  12. // Call calls the given method on interface it implements. This will return
  13. // an error with errNotImplemented if the method hasn't been implemented
  14. // and will return a ReturnInterface if it does.
  15. Call(method string) (ReturnInterface, error)
  16. }