transaction: Add ModuleTransaction type and ModuleHandler interface
This allows to easily define go-handlers for module operations. We need to expose few more types externally so that it's possible to create the module transaction handler and return specific transaction errors
This commit is contained in:
@@ -124,11 +124,15 @@ func cbPAMConv(s C.int, msg *C.char, c C.uintptr_t) (*C.char, C.int) {
|
||||
return C.CString(r), success
|
||||
}
|
||||
|
||||
// NativeHandle is the type of the native PAM handle for a transaction so that
|
||||
// it can be exported
|
||||
type NativeHandle = *C.pam_handle_t
|
||||
|
||||
// transactionBase is a handler for a PAM transaction that can be used to
|
||||
// group the operations that can be performed both by the application and the
|
||||
// module side
|
||||
type transactionBase struct {
|
||||
handle *C.pam_handle_t
|
||||
handle NativeHandle
|
||||
lastStatus atomic.Int32
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user