本站源代码
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

22 rindas
857B

  1. package goth
  2. // Params is used to pass data to sessions for authorization. An existing
  3. // implementation, and the one most likely to be used, is `url.Values`.
  4. type Params interface {
  5. Get(string) string
  6. }
  7. // Session needs to be implemented as part of the provider package.
  8. // It will be marshaled and persisted between requests to "tie"
  9. // the start and the end of the authorization process with a
  10. // 3rd party provider.
  11. type Session interface {
  12. // GetAuthURL returns the URL for the authentication end-point for the provider.
  13. GetAuthURL() (string, error)
  14. // Marshal generates a string representation of the Session for storing between requests.
  15. Marshal() string
  16. // Authorize should validate the data from the provider and return an access token
  17. // that can be stored for later access to the provider.
  18. Authorize(Provider, Params) (string, error)
  19. }
上海开阖软件有限公司 沪ICP备12045867号-1