io.go 542 B

1234567891011121314151617181920212223
  1. // Automatically generated by internal/cmd/genreadfile/main.go. DO NOT EDIT
  2. package jwe
  3. import "os"
  4. // ReadFileOption describes options that can be passed to ReadFile.
  5. // Currently there are no options available that can be passed to ReadFile, but
  6. // it is provided here for anticipated future additions
  7. type ReadFileOption interface {
  8. Option
  9. readFileOption()
  10. }
  11. func ReadFile(path string, _ ...ReadFileOption) (*Message, error) {
  12. f, err := os.Open(path)
  13. if err != nil {
  14. return nil, err
  15. }
  16. defer f.Close()
  17. return ParseReader(f)
  18. }