1// This file was generated by error.sh
2// DO NOT EDIT FILE
3//
4package forestdb
5
6//#include <libforestdb/forestdb.h>
7import "C"
8import "fmt"
9
10type Error int
11
12func (e Error) Error() string {
13	msg, ok := codeMap[int(e)]
14	if !ok {
15		msg = fmt.Sprintf("Unknown forestdb error %d", int(e))
16	}
17	return msg
18}
19
20const RESULT_SUCCESS C.fdb_status = C.FDB_RESULT_SUCCESS
21const RESULT_ITERATOR_FAIL = FDB_RESULT_ITERATOR_FAIL
22const (
23	FDB_RESULT_AIO_GETEVENTS_FAIL         Error = C.FDB_RESULT_AIO_GETEVENTS_FAIL
24	FDB_RESULT_AIO_INIT_FAIL              Error = C.FDB_RESULT_AIO_INIT_FAIL
25	FDB_RESULT_AIO_NOT_SUPPORTED          Error = C.FDB_RESULT_AIO_NOT_SUPPORTED
26	FDB_RESULT_AIO_SUBMIT_FAIL            Error = C.FDB_RESULT_AIO_SUBMIT_FAIL
27	FDB_RESULT_ALLOC_FAIL                 Error = C.FDB_RESULT_ALLOC_FAIL
28	FDB_RESULT_CHECKSUM_ERROR             Error = C.FDB_RESULT_CHECKSUM_ERROR
29	FDB_RESULT_CLOSE_FAIL                 Error = C.FDB_RESULT_CLOSE_FAIL
30	FDB_RESULT_COMMIT_FAIL                Error = C.FDB_RESULT_COMMIT_FAIL
31	FDB_RESULT_COMPACTION_CANCELLATION    Error = C.FDB_RESULT_COMPACTION_CANCELLATION
32	FDB_RESULT_COMPACTION_FAIL            Error = C.FDB_RESULT_COMPACTION_FAIL
33	FDB_RESULT_COMPRESSION_FAIL           Error = C.FDB_RESULT_COMPRESSION_FAIL
34	FDB_RESULT_CRYPTO_ERROR               Error = C.FDB_RESULT_CRYPTO_ERROR
35	FDB_RESULT_EACCESS                    Error = C.FDB_RESULT_EACCESS
36	FDB_RESULT_EAGAIN                     Error = C.FDB_RESULT_EAGAIN
37	FDB_RESULT_EBADF                      Error = C.FDB_RESULT_EBADF
38	FDB_RESULT_EEXIST                     Error = C.FDB_RESULT_EEXIST
39	FDB_RESULT_EFAULT                     Error = C.FDB_RESULT_EFAULT
40	FDB_RESULT_EFBIG                      Error = C.FDB_RESULT_EFBIG
41	FDB_RESULT_EINVAL                     Error = C.FDB_RESULT_EINVAL
42	FDB_RESULT_EIO                        Error = C.FDB_RESULT_EIO
43	FDB_RESULT_EISDIR                     Error = C.FDB_RESULT_EISDIR
44	FDB_RESULT_ELOOP                      Error = C.FDB_RESULT_ELOOP
45	FDB_RESULT_EMFILE                     Error = C.FDB_RESULT_EMFILE
46	FDB_RESULT_ENAMETOOLONG               Error = C.FDB_RESULT_ENAMETOOLONG
47	FDB_RESULT_ENFILE                     Error = C.FDB_RESULT_ENFILE
48	FDB_RESULT_ENOBUFS                    Error = C.FDB_RESULT_ENOBUFS
49	FDB_RESULT_ENODEV                     Error = C.FDB_RESULT_ENODEV
50	FDB_RESULT_ENOMEM                     Error = C.FDB_RESULT_ENOMEM
51	FDB_RESULT_ENOSPC                     Error = C.FDB_RESULT_ENOSPC
52	FDB_RESULT_ENOTDIR                    Error = C.FDB_RESULT_ENOTDIR
53	FDB_RESULT_ENXIO                      Error = C.FDB_RESULT_ENXIO
54	FDB_RESULT_EOPNOTSUPP                 Error = C.FDB_RESULT_EOPNOTSUPP
55	FDB_RESULT_EOVERFLOW                  Error = C.FDB_RESULT_EOVERFLOW
56	FDB_RESULT_EPERM                      Error = C.FDB_RESULT_EPERM
57	FDB_RESULT_EROFS                      Error = C.FDB_RESULT_EROFS
58	FDB_RESULT_FAIL_BY_COMPACTION         Error = C.FDB_RESULT_FAIL_BY_COMPACTION
59	FDB_RESULT_FAIL_BY_ROLLBACK           Error = C.FDB_RESULT_FAIL_BY_ROLLBACK
60	FDB_RESULT_FAIL_BY_TRANSACTION        Error = C.FDB_RESULT_FAIL_BY_TRANSACTION
61	FDB_RESULT_FILE_CORRUPTION            Error = C.FDB_RESULT_FILE_CORRUPTION
62	FDB_RESULT_FILE_IS_BUSY               Error = C.FDB_RESULT_FILE_IS_BUSY
63	FDB_RESULT_FILE_NOT_OPEN              Error = C.FDB_RESULT_FILE_NOT_OPEN
64	FDB_RESULT_FILE_REMOVE_FAIL           Error = C.FDB_RESULT_FILE_REMOVE_FAIL
65	FDB_RESULT_FILE_RENAME_FAIL           Error = C.FDB_RESULT_FILE_RENAME_FAIL
66	FDB_RESULT_FILE_VERSION_NOT_SUPPORTED Error = C.FDB_RESULT_FILE_VERSION_NOT_SUPPORTED
67	FDB_RESULT_FSYNC_FAIL                 Error = C.FDB_RESULT_FSYNC_FAIL
68	FDB_RESULT_HANDLE_BUSY                Error = C.FDB_RESULT_HANDLE_BUSY
69	FDB_RESULT_INVALID_ARGS               Error = C.FDB_RESULT_INVALID_ARGS
70	FDB_RESULT_INVALID_CMP_FUNCTION       Error = C.FDB_RESULT_INVALID_CMP_FUNCTION
71	FDB_RESULT_INVALID_COMPACTION_MODE    Error = C.FDB_RESULT_INVALID_COMPACTION_MODE
72	FDB_RESULT_INVALID_CONFIG             Error = C.FDB_RESULT_INVALID_CONFIG
73	FDB_RESULT_INVALID_HANDLE             Error = C.FDB_RESULT_INVALID_HANDLE
74	FDB_RESULT_INVALID_KV_INSTANCE_NAME   Error = C.FDB_RESULT_INVALID_KV_INSTANCE_NAME
75	FDB_RESULT_IN_USE_BY_COMPACTOR        Error = C.FDB_RESULT_IN_USE_BY_COMPACTOR
76	FDB_RESULT_ITERATOR_FAIL              Error = C.FDB_RESULT_ITERATOR_FAIL
77	FDB_RESULT_KEY_NOT_FOUND              Error = C.FDB_RESULT_KEY_NOT_FOUND
78	FDB_RESULT_KV_STORE_BUSY              Error = C.FDB_RESULT_KV_STORE_BUSY
79	FDB_RESULT_KV_STORE_NOT_FOUND         Error = C.FDB_RESULT_KV_STORE_NOT_FOUND
80	FDB_RESULT_MANUAL_COMPACTION_FAIL     Error = C.FDB_RESULT_MANUAL_COMPACTION_FAIL
81	FDB_RESULT_NO_DB_HEADERS              Error = C.FDB_RESULT_NO_DB_HEADERS
82	FDB_RESULT_NO_DB_INSTANCE             Error = C.FDB_RESULT_NO_DB_INSTANCE
83	FDB_RESULT_NO_SUCH_FILE               Error = C.FDB_RESULT_NO_SUCH_FILE
84	FDB_RESULT_OPEN_FAIL                  Error = C.FDB_RESULT_OPEN_FAIL
85	FDB_RESULT_READ_FAIL                  Error = C.FDB_RESULT_READ_FAIL
86	FDB_RESULT_RONLY_VIOLATION            Error = C.FDB_RESULT_RONLY_VIOLATION
87	FDB_RESULT_SB_INIT_FAIL               Error = C.FDB_RESULT_SB_INIT_FAIL
88	FDB_RESULT_SB_RACE_CONDITION          Error = C.FDB_RESULT_SB_RACE_CONDITION
89	FDB_RESULT_SB_READ_FAIL               Error = C.FDB_RESULT_SB_READ_FAIL
90	FDB_RESULT_SEEK_FAIL                  Error = C.FDB_RESULT_SEEK_FAIL
91	FDB_RESULT_SUCCESS                    Error = C.FDB_RESULT_SUCCESS
92	FDB_RESULT_TOO_BIG_BUFFER_CACHE       Error = C.FDB_RESULT_TOO_BIG_BUFFER_CACHE
93	FDB_RESULT_TOO_LONG_FILENAME          Error = C.FDB_RESULT_TOO_LONG_FILENAME
94	FDB_RESULT_TRANSACTION_FAIL           Error = C.FDB_RESULT_TRANSACTION_FAIL
95	FDB_RESULT_WRITE_FAIL                 Error = C.FDB_RESULT_WRITE_FAIL
96)
97
98var codeMap = map[int]string{
99	C.FDB_RESULT_AIO_GETEVENTS_FAIL:         `FDB_RESULT_AIO_GETEVENTS_FAIL`,
100	C.FDB_RESULT_AIO_INIT_FAIL:              `FDB_RESULT_AIO_INIT_FAIL`,
101	C.FDB_RESULT_AIO_NOT_SUPPORTED:          `FDB_RESULT_AIO_NOT_SUPPORTED`,
102	C.FDB_RESULT_AIO_SUBMIT_FAIL:            `FDB_RESULT_AIO_SUBMIT_FAIL`,
103	C.FDB_RESULT_ALLOC_FAIL:                 `FDB_RESULT_ALLOC_FAIL`,
104	C.FDB_RESULT_CHECKSUM_ERROR:             `FDB_RESULT_CHECKSUM_ERROR`,
105	C.FDB_RESULT_CLOSE_FAIL:                 `FDB_RESULT_CLOSE_FAIL`,
106	C.FDB_RESULT_COMMIT_FAIL:                `FDB_RESULT_COMMIT_FAIL`,
107	C.FDB_RESULT_COMPACTION_CANCELLATION:    `FDB_RESULT_COMPACTION_CANCELLATION`,
108	C.FDB_RESULT_COMPACTION_FAIL:            `FDB_RESULT_COMPACTION_FAIL`,
109	C.FDB_RESULT_COMPRESSION_FAIL:           `FDB_RESULT_COMPRESSION_FAIL`,
110	C.FDB_RESULT_CRYPTO_ERROR:               `FDB_RESULT_CRYPTO_ERROR`,
111	C.FDB_RESULT_EACCESS:                    `FDB_RESULT_EACCESS`,
112	C.FDB_RESULT_EAGAIN:                     `FDB_RESULT_EAGAIN`,
113	C.FDB_RESULT_EBADF:                      `FDB_RESULT_EBADF`,
114	C.FDB_RESULT_EEXIST:                     `FDB_RESULT_EEXIST`,
115	C.FDB_RESULT_EFAULT:                     `FDB_RESULT_EFAULT`,
116	C.FDB_RESULT_EFBIG:                      `FDB_RESULT_EFBIG`,
117	C.FDB_RESULT_EINVAL:                     `FDB_RESULT_EINVAL`,
118	C.FDB_RESULT_EIO:                        `FDB_RESULT_EIO`,
119	C.FDB_RESULT_EISDIR:                     `FDB_RESULT_EISDIR`,
120	C.FDB_RESULT_ELOOP:                      `FDB_RESULT_ELOOP`,
121	C.FDB_RESULT_EMFILE:                     `FDB_RESULT_EMFILE`,
122	C.FDB_RESULT_ENAMETOOLONG:               `FDB_RESULT_ENAMETOOLONG`,
123	C.FDB_RESULT_ENFILE:                     `FDB_RESULT_ENFILE`,
124	C.FDB_RESULT_ENOBUFS:                    `FDB_RESULT_ENOBUFS`,
125	C.FDB_RESULT_ENODEV:                     `FDB_RESULT_ENODEV`,
126	C.FDB_RESULT_ENOMEM:                     `FDB_RESULT_ENOMEM`,
127	C.FDB_RESULT_ENOSPC:                     `FDB_RESULT_ENOSPC`,
128	C.FDB_RESULT_ENOTDIR:                    `FDB_RESULT_ENOTDIR`,
129	C.FDB_RESULT_ENXIO:                      `FDB_RESULT_ENXIO`,
130	C.FDB_RESULT_EOPNOTSUPP:                 `FDB_RESULT_EOPNOTSUPP`,
131	C.FDB_RESULT_EOVERFLOW:                  `FDB_RESULT_EOVERFLOW`,
132	C.FDB_RESULT_EPERM:                      `FDB_RESULT_EPERM`,
133	C.FDB_RESULT_EROFS:                      `FDB_RESULT_EROFS`,
134	C.FDB_RESULT_FAIL_BY_COMPACTION:         `FDB_RESULT_FAIL_BY_COMPACTION`,
135	C.FDB_RESULT_FAIL_BY_ROLLBACK:           `FDB_RESULT_FAIL_BY_ROLLBACK`,
136	C.FDB_RESULT_FAIL_BY_TRANSACTION:        `FDB_RESULT_FAIL_BY_TRANSACTION`,
137	C.FDB_RESULT_FILE_CORRUPTION:            `FDB_RESULT_FILE_CORRUPTION`,
138	C.FDB_RESULT_FILE_IS_BUSY:               `FDB_RESULT_FILE_IS_BUSY`,
139	C.FDB_RESULT_FILE_NOT_OPEN:              `FDB_RESULT_FILE_NOT_OPEN`,
140	C.FDB_RESULT_FILE_REMOVE_FAIL:           `FDB_RESULT_FILE_REMOVE_FAIL`,
141	C.FDB_RESULT_FILE_RENAME_FAIL:           `FDB_RESULT_FILE_RENAME_FAIL`,
142	C.FDB_RESULT_FILE_VERSION_NOT_SUPPORTED: `FDB_RESULT_FILE_VERSION_NOT_SUPPORTED`,
143	C.FDB_RESULT_FSYNC_FAIL:                 `FDB_RESULT_FSYNC_FAIL`,
144	C.FDB_RESULT_HANDLE_BUSY:                `FDB_RESULT_HANDLE_BUSY`,
145	C.FDB_RESULT_INVALID_ARGS:               `FDB_RESULT_INVALID_ARGS`,
146	C.FDB_RESULT_INVALID_CMP_FUNCTION:       `FDB_RESULT_INVALID_CMP_FUNCTION`,
147	C.FDB_RESULT_INVALID_COMPACTION_MODE:    `FDB_RESULT_INVALID_COMPACTION_MODE`,
148	C.FDB_RESULT_INVALID_CONFIG:             `FDB_RESULT_INVALID_CONFIG`,
149	C.FDB_RESULT_INVALID_HANDLE:             `FDB_RESULT_INVALID_HANDLE`,
150	C.FDB_RESULT_INVALID_KV_INSTANCE_NAME:   `FDB_RESULT_INVALID_KV_INSTANCE_NAME`,
151	C.FDB_RESULT_IN_USE_BY_COMPACTOR:        `FDB_RESULT_IN_USE_BY_COMPACTOR`,
152	C.FDB_RESULT_ITERATOR_FAIL:              `FDB_RESULT_ITERATOR_FAIL`,
153	C.FDB_RESULT_KEY_NOT_FOUND:              `FDB_RESULT_KEY_NOT_FOUND`,
154	C.FDB_RESULT_KV_STORE_BUSY:              `FDB_RESULT_KV_STORE_BUSY`,
155	C.FDB_RESULT_KV_STORE_NOT_FOUND:         `FDB_RESULT_KV_STORE_NOT_FOUND`,
156	C.FDB_RESULT_MANUAL_COMPACTION_FAIL:     `FDB_RESULT_MANUAL_COMPACTION_FAIL`,
157	C.FDB_RESULT_NO_DB_HEADERS:              `FDB_RESULT_NO_DB_HEADERS`,
158	C.FDB_RESULT_NO_DB_INSTANCE:             `FDB_RESULT_NO_DB_INSTANCE`,
159	C.FDB_RESULT_NO_SUCH_FILE:               `FDB_RESULT_NO_SUCH_FILE`,
160	C.FDB_RESULT_OPEN_FAIL:                  `FDB_RESULT_OPEN_FAIL`,
161	C.FDB_RESULT_READ_FAIL:                  `FDB_RESULT_READ_FAIL`,
162	C.FDB_RESULT_RONLY_VIOLATION:            `FDB_RESULT_RONLY_VIOLATION`,
163	C.FDB_RESULT_SB_INIT_FAIL:               `FDB_RESULT_SB_INIT_FAIL`,
164	C.FDB_RESULT_SB_RACE_CONDITION:          `FDB_RESULT_SB_RACE_CONDITION`,
165	C.FDB_RESULT_SB_READ_FAIL:               `FDB_RESULT_SB_READ_FAIL`,
166	C.FDB_RESULT_SEEK_FAIL:                  `FDB_RESULT_SEEK_FAIL`,
167	C.FDB_RESULT_SUCCESS:                    `FDB_RESULT_SUCCESS`,
168	C.FDB_RESULT_TOO_BIG_BUFFER_CACHE:       `FDB_RESULT_TOO_BIG_BUFFER_CACHE`,
169	C.FDB_RESULT_TOO_LONG_FILENAME:          `FDB_RESULT_TOO_LONG_FILENAME`,
170	C.FDB_RESULT_TRANSACTION_FAIL:           `FDB_RESULT_TRANSACTION_FAIL`,
171	C.FDB_RESULT_WRITE_FAIL:                 `FDB_RESULT_WRITE_FAIL`,
172}
173