go-ayo/common을 gocommon으로 분리
This commit is contained in:
22
document/document.go
Normal file
22
document/document.go
Normal file
@ -0,0 +1,22 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user