gi-secret-0.0.2: Libsecret bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Secret.Structs.Value

Contents

Description

A secret value, like a password or other binary secret.

Synopsis

Exported types

newtype Value Source #

Constructors

Value (ManagedPtr Value) 

Instances

BoxedObject Value Source # 

Methods

boxedType :: Value -> IO GType #

((~) * info (ResolveValueMethod t Value), MethodInfo * info Value p) => IsLabel t (Value -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> Value -> p #

((~) * info (ResolveValueMethod t Value), MethodInfo * info Value p) => IsLabelProxy t (Value -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> Value -> p #

HasAttributeList * Value Source # 
((~) * signature (m ()), MonadIO m) => MethodInfo * ValueUnrefMethodInfo Value signature Source # 
((~) * signature (m Value), MonadIO m) => MethodInfo * ValueRefMethodInfo Value signature Source # 
((~) * signature (m (Maybe Text)), MonadIO m) => MethodInfo * ValueGetTextMethodInfo Value signature Source # 
((~) * signature (m Text), MonadIO m) => MethodInfo * ValueGetContentTypeMethodInfo Value signature Source # 
((~) * signature (m ByteString), MonadIO m) => MethodInfo * ValueGetMethodInfo Value signature Source # 
type AttributeList Value Source # 

Methods

get

data ValueGetMethodInfo Source #

Instances

((~) * signature (m ByteString), MonadIO m) => MethodInfo * ValueGetMethodInfo Value signature Source # 

valueGet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the value

-> m ByteString

Returns: the secret data

Get the secret data in the Value. The value is not necessarily null-terminated unless it was created with valueNew or a null-terminated string was passed to valueNewFull.

getContentType

valueGetContentType Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the value

-> m Text

Returns: the content type

Get the content type of the secret value, such as <literal>text/plain</literal>.

getText

data ValueGetTextMethodInfo Source #

Instances

((~) * signature (m (Maybe Text)), MonadIO m) => MethodInfo * ValueGetTextMethodInfo Value signature Source # 

valueGetText Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: the value

-> m (Maybe Text)

Returns: the content type

Get the secret data in the Value if it contains a textual value. The content type must be <literal>text/plain</literal>.

new

valueNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

secret: the secret data

-> Int64

length: the length of the data

-> Text

contentType: the content type of the data

-> m Value

Returns: the new Value

Create a Value for the secret data passed in. The secret data is copied into non-pageable 'secure' memory.

If the length is less than zero, then secret is assumed to be null-terminated.

newFull

valueNewFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

secret: the secret data

-> Int64

length: the length of the data

-> Text

contentType: the content type of the data

-> DestroyNotify

destroy: function to call to free the secret data

-> m Value

Returns: the new Value

Create a Value for the secret data passed in. The secret data is not copied, and will later be freed with the destroy function.

If the length is less than zero, then secret is assumed to be null-terminated.

ref

data ValueRefMethodInfo Source #

Instances

((~) * signature (m Value), MonadIO m) => MethodInfo * ValueRefMethodInfo Value signature Source # 

valueRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: value to reference

-> m Value

Returns: the value

Add another reference to the Value. For each reference valueUnref should be called to unreference the value.

unref

data ValueUnrefMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m) => MethodInfo * ValueUnrefMethodInfo Value signature Source # 

valueUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Value

value: value to unreference

-> m () 

Unreference a Value. When the last reference is gone, then the value will be freed.