Documentation
¶
Index ¶
- type Error1
- type Error2
- type Error3
- type Error4
- func (e Error4[E1, E2, E3, E4]) Failure1() (E1, bool)
- func (e Error4[E1, E2, E3, E4]) Failure2() (E2, bool)
- func (e Error4[E1, E2, E3, E4]) Failure3() (E3, bool)
- func (e Error4[E1, E2, E3, E4]) Failure4() (E4, bool)
- func (e *Error4[E1, E2, E3, E4]) FromFailure1(err E1)
- func (e *Error4[E1, E2, E3, E4]) FromFailure2(err E2)
- func (e *Error4[E1, E2, E3, E4]) FromFailure3(err E3)
- func (e *Error4[E1, E2, E3, E4]) FromFailure4(err E4)
- type Error5
- func (e Error5[E1, E2, E3, E4, E5]) Failure1() (E1, bool)
- func (e Error5[E1, E2, E3, E4, E5]) Failure2() (E2, bool)
- func (e Error5[E1, E2, E3, E4, E5]) Failure3() (E3, bool)
- func (e Error5[E1, E2, E3, E4, E5]) Failure4() (E4, bool)
- func (e Error5[E1, E2, E3, E4, E5]) Failure5() (E5, bool)
- func (e *Error5[E1, E2, E3, E4, E5]) FromFailure1(err E1)
- func (e *Error5[E1, E2, E3, E4, E5]) FromFailure2(err E2)
- func (e *Error5[E1, E2, E3, E4, E5]) FromFailure3(err E3)
- func (e *Error5[E1, E2, E3, E4, E5]) FromFailure4(err E4)
- func (e *Error5[E1, E2, E3, E4, E5]) FromFailure5(err E5)
- type Result1
- type Result2
- func (r *Result2[T, E1, E2]) FromFailure1(err E1)
- func (r *Result2[T, E1, E2]) FromFailure2(err E2)
- func (r *Result2[T, E1, E2]) FromSuccess(value T)
- func (r Result2[T, E1, E2]) IsFailure() bool
- func (r Result2[T, E1, E2]) IsSuccess() bool
- func (r Result2[T, E1, E2]) Unpack() (T, Error2[E1, E2], bool)
- type Result3
- func (r *Result3[T, E1, E2, E3]) FromFailure1(err E1)
- func (r *Result3[T, E1, E2, E3]) FromFailure2(err E2)
- func (r *Result3[T, E1, E2, E3]) FromFailure3(err E3)
- func (r *Result3[T, E1, E2, E3]) FromSuccess(value T)
- func (r Result3[T, E1, E2, E3]) IsFailure() bool
- func (r Result3[T, E1, E2, E3]) IsSuccess() bool
- func (r Result3[T, E1, E2, E3]) Unpack() (T, Error3[E1, E2, E3], bool)
- type Result4
- func (r *Result4[T, E1, E2, E3, E4]) FromFailure1(err E1)
- func (r *Result4[T, E1, E2, E3, E4]) FromFailure2(err E2)
- func (r *Result4[T, E1, E2, E3, E4]) FromFailure3(err E3)
- func (r *Result4[T, E1, E2, E3, E4]) FromFailure4(err E4)
- func (r *Result4[T, E1, E2, E3, E4]) FromSuccess(value T)
- func (r Result4[T, E1, E2, E3, E4]) IsFailure() bool
- func (r Result4[T, E1, E2, E3, E4]) IsSuccess() bool
- func (r Result4[T, E1, E2, E3, E4]) Unpack() (T, Error4[E1, E2, E3, E4], bool)
- type Result5
- func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure1(err E1)
- func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure2(err E2)
- func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure3(err E3)
- func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure4(err E4)
- func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure5(err E5)
- func (r *Result5[T, E1, E2, E3, E4, E5]) FromSuccess(value T)
- func (r Result5[T, E1, E2, E3, E4, E5]) IsFailure() bool
- func (r Result5[T, E1, E2, E3, E4, E5]) IsSuccess() bool
- func (r Result5[T, E1, E2, E3, E4, E5]) Unpack() (T, Error5[E1, E2, E3, E4, E5], bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error1 ¶
type Error1[E1 error] struct { // contains filtered or unexported fields }
Error is a type that can be used to represent an error with only one case.
func (*Error1[E1]) FromFailure ¶
func (e *Error1[E1]) FromFailure(err E1)
Overwrite the error into the first case with the given error.
type Error2 ¶
Code generated by github.com/akishichinibu/r. DO NOT EDIT.
Error2 is a type that can be used to represent an error with 2 cases.
func (*Error2[E1, E2]) FromFailure1 ¶
func (e *Error2[E1, E2]) FromFailure1(err E1)
Overwrite the error into the case 1 with the given error.
func (*Error2[E1, E2]) FromFailure2 ¶
func (e *Error2[E1, E2]) FromFailure2(err E2)
Overwrite the error into the case 2 with the given error.
type Error3 ¶
Error3 is a type that can be used to represent an error with 3 cases.
func (*Error3[E1, E2, E3]) FromFailure1 ¶
func (e *Error3[E1, E2, E3]) FromFailure1(err E1)
Overwrite the error into the case 1 with the given error.
func (*Error3[E1, E2, E3]) FromFailure2 ¶
func (e *Error3[E1, E2, E3]) FromFailure2(err E2)
Overwrite the error into the case 2 with the given error.
func (*Error3[E1, E2, E3]) FromFailure3 ¶
func (e *Error3[E1, E2, E3]) FromFailure3(err E3)
Overwrite the error into the case 3 with the given error.
type Error4 ¶
type Error4[E1 error, E2 error, E3 error, E4 error] struct { // contains filtered or unexported fields }
Error4 is a type that can be used to represent an error with 4 cases.
func (*Error4[E1, E2, E3, E4]) FromFailure1 ¶
func (e *Error4[E1, E2, E3, E4]) FromFailure1(err E1)
Overwrite the error into the case 1 with the given error.
func (*Error4[E1, E2, E3, E4]) FromFailure2 ¶
func (e *Error4[E1, E2, E3, E4]) FromFailure2(err E2)
Overwrite the error into the case 2 with the given error.
func (*Error4[E1, E2, E3, E4]) FromFailure3 ¶
func (e *Error4[E1, E2, E3, E4]) FromFailure3(err E3)
Overwrite the error into the case 3 with the given error.
func (*Error4[E1, E2, E3, E4]) FromFailure4 ¶
func (e *Error4[E1, E2, E3, E4]) FromFailure4(err E4)
Overwrite the error into the case 4 with the given error.
type Error5 ¶
type Error5[E1 error, E2 error, E3 error, E4 error, E5 error] struct { // contains filtered or unexported fields }
Error5 is a type that can be used to represent an error with 5 cases.
func (*Error5[E1, E2, E3, E4, E5]) FromFailure1 ¶
func (e *Error5[E1, E2, E3, E4, E5]) FromFailure1(err E1)
Overwrite the error into the case 1 with the given error.
func (*Error5[E1, E2, E3, E4, E5]) FromFailure2 ¶
func (e *Error5[E1, E2, E3, E4, E5]) FromFailure2(err E2)
Overwrite the error into the case 2 with the given error.
func (*Error5[E1, E2, E3, E4, E5]) FromFailure3 ¶
func (e *Error5[E1, E2, E3, E4, E5]) FromFailure3(err E3)
Overwrite the error into the case 3 with the given error.
func (*Error5[E1, E2, E3, E4, E5]) FromFailure4 ¶
func (e *Error5[E1, E2, E3, E4, E5]) FromFailure4(err E4)
Overwrite the error into the case 4 with the given error.
func (*Error5[E1, E2, E3, E4, E5]) FromFailure5 ¶
func (e *Error5[E1, E2, E3, E4, E5]) FromFailure5(err E5)
Overwrite the error into the case 5 with the given error.
type Result1 ¶
Result1 is a type that can be used to represent a result that contains a value in success case and one error in failure case.
func (*Result1[T, E1]) FromFailure ¶
func (r *Result1[T, E1]) FromFailure(err E1)
Overwrite the error of the result with the given error into the first failure case.
func (*Result1[T, E1]) FromSuccess ¶
func (r *Result1[T, E1]) FromSuccess(value T)
Overwrite the value of the result with the given value into the success case.
type Result2 ¶
Code generated by github.com/akishichinibu/r. DO NOT EDIT.
Result2 is a type that can be used to represent a result that contains a value in success case and 2 error types in failure case.
func (*Result2[T, E1, E2]) FromFailure1 ¶
func (r *Result2[T, E1, E2]) FromFailure1(err E1)
Overwrite the error of the result with the given error into the failure case 1.
func (*Result2[T, E1, E2]) FromFailure2 ¶
func (r *Result2[T, E1, E2]) FromFailure2(err E2)
Overwrite the error of the result with the given error into the failure case 2.
func (*Result2[T, E1, E2]) FromSuccess ¶
func (r *Result2[T, E1, E2]) FromSuccess(value T)
Overwrite the value of the result with the given value into the success case.
type Result3 ¶
type Result3[T any, E1 error, E2 error, E3 error] struct { // contains filtered or unexported fields }
Result3 is a type that can be used to represent a result that contains a value in success case and 3 error types in failure case.
func (*Result3[T, E1, E2, E3]) FromFailure1 ¶
func (r *Result3[T, E1, E2, E3]) FromFailure1(err E1)
Overwrite the error of the result with the given error into the failure case 1.
func (*Result3[T, E1, E2, E3]) FromFailure2 ¶
func (r *Result3[T, E1, E2, E3]) FromFailure2(err E2)
Overwrite the error of the result with the given error into the failure case 2.
func (*Result3[T, E1, E2, E3]) FromFailure3 ¶
func (r *Result3[T, E1, E2, E3]) FromFailure3(err E3)
Overwrite the error of the result with the given error into the failure case 3.
func (*Result3[T, E1, E2, E3]) FromSuccess ¶
func (r *Result3[T, E1, E2, E3]) FromSuccess(value T)
Overwrite the value of the result with the given value into the success case.
type Result4 ¶
type Result4[T any, E1 error, E2 error, E3 error, E4 error] struct { // contains filtered or unexported fields }
Result4 is a type that can be used to represent a result that contains a value in success case and 4 error types in failure case.
func (*Result4[T, E1, E2, E3, E4]) FromFailure1 ¶
func (r *Result4[T, E1, E2, E3, E4]) FromFailure1(err E1)
Overwrite the error of the result with the given error into the failure case 1.
func (*Result4[T, E1, E2, E3, E4]) FromFailure2 ¶
func (r *Result4[T, E1, E2, E3, E4]) FromFailure2(err E2)
Overwrite the error of the result with the given error into the failure case 2.
func (*Result4[T, E1, E2, E3, E4]) FromFailure3 ¶
func (r *Result4[T, E1, E2, E3, E4]) FromFailure3(err E3)
Overwrite the error of the result with the given error into the failure case 3.
func (*Result4[T, E1, E2, E3, E4]) FromFailure4 ¶
func (r *Result4[T, E1, E2, E3, E4]) FromFailure4(err E4)
Overwrite the error of the result with the given error into the failure case 4.
func (*Result4[T, E1, E2, E3, E4]) FromSuccess ¶
func (r *Result4[T, E1, E2, E3, E4]) FromSuccess(value T)
Overwrite the value of the result with the given value into the success case.
type Result5 ¶
type Result5[T any, E1 error, E2 error, E3 error, E4 error, E5 error] struct { // contains filtered or unexported fields }
Result5 is a type that can be used to represent a result that contains a value in success case and 5 error types in failure case.
func (*Result5[T, E1, E2, E3, E4, E5]) FromFailure1 ¶
func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure1(err E1)
Overwrite the error of the result with the given error into the failure case 1.
func (*Result5[T, E1, E2, E3, E4, E5]) FromFailure2 ¶
func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure2(err E2)
Overwrite the error of the result with the given error into the failure case 2.
func (*Result5[T, E1, E2, E3, E4, E5]) FromFailure3 ¶
func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure3(err E3)
Overwrite the error of the result with the given error into the failure case 3.
func (*Result5[T, E1, E2, E3, E4, E5]) FromFailure4 ¶
func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure4(err E4)
Overwrite the error of the result with the given error into the failure case 4.
func (*Result5[T, E1, E2, E3, E4, E5]) FromFailure5 ¶
func (r *Result5[T, E1, E2, E3, E4, E5]) FromFailure5(err E5)
Overwrite the error of the result with the given error into the failure case 5.
func (*Result5[T, E1, E2, E3, E4, E5]) FromSuccess ¶
func (r *Result5[T, E1, E2, E3, E4, E5]) FromSuccess(value T)
Overwrite the value of the result with the given value into the success case.