Documentation ¶
Index ¶
Constants ¶
View Source
const ( SuccessInsert = "success_create" SuccessUpdate = "success_update" SuccessDelete = "success_delete" SuccessRead = "success_read" SuccessDownload = "success_download" SuccessSend = "success_send" SuccessTransfer = "success_transfer" )
View Source
const ( ErrNoResult = "err_no_result" ErrInvalidDate = "err_invalid_date" ErrInvalidDateRange = "err_date_range" ErrWalletSuspended = "err_wallet_suspended" ErrMinimumTransfer = "err_minimum_transfer" ErrMaximumTransfer = "err_maximum_transfer" ErrNominalNotMatch = "err_nominal_not_match" ErrInvalidMutationID = "err_mutation_id" ErrInvalidMutationStatus = "err_mutation_status" ErrId = "err_invalid_id" ErrDebitNoteType = "err_debit_note_type" ErrCreditNoteType = "err_credit_note_type" ErrWeight = "err_weight" ErrCourier = "err_courier" ErrExist = "err_exist" ErrContactExist = "err_contact_exist" ErrConvertCoin = "err_convert_coin" ErrSuspended = "err_suspended" //Error Validation ValidationErrMandatory = "err_mandatory" // ValidationErrInvalidEmail = "err_invalid_email" ValidationErrNumberType = "err_number_type" ValidationErrGreatable = "err_greater_than" ValidationErrLowerable = "err_lower_than" ValidationErrMinChar = "err_min_char" ValidationErrMaxChar = "err_max_char" ValidationErrStartwith = "err_startwith" ValidationErrLen = "err_len" ValidationErrOneof = "err_oneof" // Authorization ErrInvalidOrEmptyToken = "err_invalid_token" ErrorHttpInvalidServiceToken = "err_invalid_service_token" ErrTokenIsExpired = "err_token_expired" ErrInvalidSignature = "err_invalid_signature" ErrAccountSuspended = "err_account_suspended" ErrDuplicateElement = "err_duplicate_element" )
Variables ¶
View Source
var CnMsg = []*i18n.Message{ { ID: SuccessRead, Other: "success get data {{.module}}!", }, { ID: SuccessInsert, Other: "success insert {{.module}}", }, { ID: SuccessUpdate, Other: "success update {{.module}}", }, { ID: SuccessDelete, Other: "success delete {{.module}}", }, { ID: ErrNoResult, Other: "resource {{ .module }} not found", }, { ID: ErrInvalidDate, Other: "invalid date range", }, { ID: ErrInvalidDateRange, Other: "start date must be less than end date", }, { ID: ErrId, Other: "{{.module}} id is required", }, { ID: ErrSuspended, Other: "{{.module}} is suspended", }, { ID: ErrMinimumTransfer, Other: "minimum transfer is Rp. 1", }, { ID: ErrMaximumTransfer, Other: "maximum transfer is Rp. 10.000.000", }, { ID: ErrNominalNotMatch, Other: "nominal not match", }, { ID: ErrInvalidMutationID, Other: "mutation unique id is required", }, { ID: ErrInvalidMutationStatus, Other: "invalid mutation status id", }, { ID: ErrDebitNoteType, Other: "invalid debit note type", }, { ID: ErrCreditNoteType, Other: "invalid credit note type", }, { ID: ErrWeight, Other: "invalid weight value", }, { ID: ErrCourier, Other: "invalid courier name", }, { ID: ErrExist, Other: "{{ .module }} already exists", }, { ID: ErrContactExist, Other: "contact already exist", }, { ID: ErrConvertCoin, Other: "can't convert cash to coin", }, { ID: ErrDuplicateElement, Other: "duplicate key value {{.module}}", }, { ID: ErrInvalidOrEmptyToken, Other: "unauthorized", }, { ID: ErrorHttpInvalidServiceToken, Other: "invalid service token", }, { ID: ErrTokenIsExpired, Other: "token is expired", }, { ID: ErrInvalidSignature, Other: "invalid signature key", }, { ID: ErrAccountSuspended, Other: "your account is suspended", }, }
View Source
var EnMsg = []*i18n.Message{ { ID: SuccessRead, Other: "success get data {{.module}}!", }, { ID: SuccessInsert, Other: "success insert {{.module}}", }, { ID: SuccessUpdate, Other: "success update {{.module}}", }, { ID: SuccessDelete, Other: "success delete {{.module}}", }, { ID: ErrNoResult, Other: "resource {{ .module }} not found", }, { ID: ErrInvalidDate, Other: "invalid date range", }, { ID: ErrInvalidDateRange, Other: "start date must be less than end date", }, { ID: ErrId, Other: "{{.module}} id is required", }, { ID: ErrSuspended, Other: "{{.module}} is suspended", }, { ID: ErrMinimumTransfer, Other: "minimum transfer is Rp. 1", }, { ID: ErrMaximumTransfer, Other: "maximum transfer is Rp. 10.000.000", }, { ID: ErrNominalNotMatch, Other: "nominal not match", }, { ID: ErrInvalidMutationID, Other: "mutation unique id is required", }, { ID: ErrInvalidMutationStatus, Other: "invalid mutation status id", }, { ID: ErrDebitNoteType, Other: "invalid debit note type", }, { ID: ErrCreditNoteType, Other: "invalid credit note type", }, { ID: ErrWeight, Other: "invalid weight value", }, { ID: ErrCourier, Other: "invalid courier name", }, { ID: ErrExist, Other: "{{ .module }} already exists", }, { ID: ErrContactExist, Other: "contact already exist", }, { ID: ErrConvertCoin, Other: "can't convert cash to coin", }, { ID: ErrDuplicateElement, Other: "duplicate key value {{.module}}", }, { ID: ErrInvalidOrEmptyToken, Other: "unauthorized", }, { ID: ErrorHttpInvalidServiceToken, Other: "invalid service token", }, { ID: ErrTokenIsExpired, Other: "token is expired", }, { ID: ErrInvalidSignature, Other: "invalid signature key", }, { ID: ErrAccountSuspended, Other: "your account is suspended", }, { ID: ValidationErrMandatory, Other: "{{ .field }} is mandatory", }, { ID: ValidationErrInvalidEmail, Other: "{{ .field }} is not valid email", }, { ID: ValidationErrNumberType, Other: "{{ .field }} must be numbers only", }, { ID: ValidationErrGreatable, Other: "{{ .field }} value must be greater than {{ .param }}", }, { ID: ValidationErrLowerable, Other: "{{ .field }} value must be lower than {{ .param }}", }, { ID: ValidationErrMinChar, Other: "{{ .field }} at least {{ .param }} characters long", }, { ID: ValidationErrMaxChar, Other: "the length of {{ .field }} must be {{ .param }} characters or fewer", }, { ID: ValidationErrStartwith, Other: "{{ .field }} must starts with {{ .param }}", }, { ID: ValidationErrLen, Other: "{{ .field }} length must {{ .param }} characters", }, { ID: ValidationErrOneof, Other: "{{ .field }} must specify one of {{ .param }}", }, }
View Source
var IdMsg = []*i18n.Message{ { ID: SuccessRead, Other: "sukses mengambil data {{.module}}!", }, { ID: SuccessInsert, Other: "sukses menyimpan {{.module}}", }, { ID: SuccessUpdate, Other: "sukses mengubah {{.module}}", }, { ID: SuccessDelete, Other: "sukses menghapus {{.module}}", }, { ID: ErrNoResult, Other: "tidak dapat menemukan {{ .module }}", }, { ID: ErrInvalidDate, Other: "tanggal tidak valid", }, { ID: ErrInvalidDateRange, Other: "tanggal mulai harus lebih awal dari tanggal berakhir", }, { ID: ErrId, Other: "{{.module}} id di butuhkan", }, { ID: ErrSuspended, Other: "{{.module}} telah dibekukan", }, { ID: ErrMinimumTransfer, Other: "minimum transfer adalah Rp. 1", }, { ID: ErrMaximumTransfer, Other: "maximum transfer adalah Rp. 10.000.000", }, { ID: ErrNominalNotMatch, Other: "nominal tidak cocok", }, { ID: ErrInvalidMutationID, Other: "id mutasi dibutuhkan", }, { ID: ErrInvalidMutationStatus, Other: "id status mutasi tidak valid", }, { ID: ErrDebitNoteType, Other: "debit note type tidak valid", }, { ID: ErrCreditNoteType, Other: "credit note type tidak valid", }, { ID: ErrWeight, Other: "berat tidak valid", }, { ID: ErrCourier, Other: "nama kurir tidak valid", }, { ID: ErrExist, Other: "{{ .module }} sudah terdaftar", }, { ID: ErrContactExist, Other: "kontak sudah terdaftar", }, { ID: ErrConvertCoin, Other: "tidak bisa konversi ke koin", }, { ID: ErrDuplicateElement, Other: "duplikat data {{.module}}", }, { ID: ErrInvalidOrEmptyToken, Other: "unauthorized", }, { ID: ErrorHttpInvalidServiceToken, Other: "invalid service token", }, { ID: ErrTokenIsExpired, Other: "token is expired", }, { ID: ErrInvalidSignature, Other: "invalid signature key", }, { ID: ErrAccountSuspended, Other: "your account is suspended", }, { ID: ValidationErrMandatory, Other: "{{ .field }} wajib diisi", }, { ID: ValidationErrInvalidEmail, Other: "{{ .field }} bukan valid email", }, { ID: ValidationErrNumberType, Other: "{{ .field }} hanya diisi angka", }, { ID: ValidationErrGreatable, Other: "{{ .field }} harus lebih besar dari {{ .param }}", }, { ID: ValidationErrLowerable, Other: "{{ .field }} harus lebih kecil dari {{ .param }}", }, { ID: ValidationErrMinChar, Other: "{{ .field }} terlalu pendek, setidaknya diisi {{ .param }} karakter atau lebih", }, { ID: ValidationErrMaxChar, Other: "{{ .field }} terlalu panjang, setidaknya diisi {{ .param }} karakter atau kurang", }, { ID: ValidationErrStartwith, Other: "{{ .field }} harus diawali dengan {{ .param }}", }, { ID: ValidationErrLen, Other: "{{ .field }} panjang karakter harus {{ .param }} karakter", }, { ID: ValidationErrOneof, Other: "{{ .field }} harus memilih salah satu dari {{ .param }}", }, }
View Source
var MyMsg = []*i18n.Message{ { ID: SuccessRead, Other: "成功获取数据 {{.module}}!", }, { ID: SuccessInsert, Other: "成功插入 {{.module}}", }, { ID: SuccessUpdate, Other: "成功更新 {{.module}}", }, { ID: SuccessDelete, Other: "删除成功 {{.module}}", }, { ID: ErrNoResult, Other: "resource {{ .module }} not found", }, { ID: ErrInvalidDate, Other: "invalid date range", }, { ID: ErrInvalidDateRange, Other: "start date must be less than end date", }, { ID: ErrId, Other: "{{.module}} id is required", }, { ID: ErrSuspended, Other: "{{.module}} is suspended", }, { ID: ErrMinimumTransfer, Other: "minimum transfer is Rp. 1", }, { ID: ErrMaximumTransfer, Other: "maximum transfer is Rp. 10.000.000", }, { ID: ErrNominalNotMatch, Other: "nominal not match", }, { ID: ErrInvalidMutationID, Other: "mutation unique id is required", }, { ID: ErrInvalidMutationStatus, Other: "invalid mutation status id", }, { ID: ErrDebitNoteType, Other: "invalid debit note type", }, { ID: ErrCreditNoteType, Other: "invalid credit note type", }, { ID: ErrWeight, Other: "invalid weight value", }, { ID: ErrCourier, Other: "invalid courier name", }, { ID: ErrExist, Other: "{{ .module }} already exists", }, { ID: ErrContactExist, Other: "contact already exist", }, { ID: ErrConvertCoin, Other: "can't convert cash to coin", }, { ID: ErrDuplicateElement, Other: "duplicate key value {{.module}}", }, { ID: ErrInvalidOrEmptyToken, Other: "unauthorized", }, { ID: ErrorHttpInvalidServiceToken, Other: "invalid service token", }, { ID: ErrTokenIsExpired, Other: "token is expired", }, { ID: ErrInvalidSignature, Other: "invalid signature key", }, { ID: ErrAccountSuspended, Other: "your account is suspended", }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.