23 lines
705 B
Go
23 lines
705 B
Go
|
|
package document
|
||
|
|
|
||
|
|
import "errors"
|
||
|
|
|
||
|
|
// Document interface
|
||
|
|
type Document interface {
|
||
|
|
ReadBool(path string) (bool, error)
|
||
|
|
ReadString(path string) (string, error)
|
||
|
|
Read(path string) (interface{}, error)
|
||
|
|
|
||
|
|
Write(path string, val interface{})
|
||
|
|
Serialize() error
|
||
|
|
}
|
||
|
|
|
||
|
|
// ErrDocumentNotExist : 문서가 존재하지 않을 때
|
||
|
|
var ErrDocumentNotExist = errors.New("document does not exist")
|
||
|
|
|
||
|
|
// ErrDocumentPathNotExist : 문서의 경로가 존재하지 않을 때
|
||
|
|
var ErrDocumentPathNotExist = errors.New("given document path does not exist")
|
||
|
|
|
||
|
|
// ErrDocumentPathTypeMismatch : 해당 경로의 값 타입이 다름
|
||
|
|
var ErrDocumentPathTypeMismatch = errors.New("given document path has different value of type")
|