Documentation
¶
Overview ¶
Package executionpolicy provides a fluent Go API over the macOS ExecutionPolicy framework.
Each With… method sets one property and returns its receiver, so configuration calls can be chained.
Index ¶
- func EPErrorDomain() obj.Object
- type DeveloperTool
- func (dt *DeveloperTool) AuthorizationStatus() DeveloperToolStatus
- func (dt *DeveloperTool) Description() string
- func (dt *DeveloperTool) IsEqual(other obj.Object) bool
- func (dt *DeveloperTool) IsKind(className string) bool
- func (dt *DeveloperTool) RequestDeveloperToolAccessWithCompletionHandler(handler func(bool))
- func (dt *DeveloperTool) String() string
- type DeveloperToolStatus
- type ExecutionPolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EPErrorDomain ¶ added in v0.8.0
EPErrorDomain returns the string constant EPErrorDomain, for use as a dictionary key or argument.
Types ¶
type DeveloperTool ¶
DeveloperTool is an idiomatic wrapper over the Objective-C class EPDeveloperTool.
func DeveloperToolFromID ¶
func DeveloperToolFromID(id objc.ID) *DeveloperTool
DeveloperToolFromID adopts an existing Objective-C object as a DeveloperTool (nil for 0), retaining it and registering a release finalizer.
func NewDeveloperTool ¶
func NewDeveloperTool() *DeveloperTool
NewDeveloperTool creates a new DeveloperTool.
func (*DeveloperTool) AuthorizationStatus ¶
func (dt *DeveloperTool) AuthorizationStatus() DeveloperToolStatus
AuthorizationStatus returns the current authorization status of the current process. - Returns: An EPDeveloperToolStatus indicating whether the current process has developer tool privileges.
func (*DeveloperTool) Description ¶ added in v0.10.0
func (dt *DeveloperTool) Description() string
Description returns the object's -description text.
func (*DeveloperTool) IsEqual ¶ added in v0.10.0
func (dt *DeveloperTool) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*DeveloperTool) IsKind ¶ added in v0.10.0
func (dt *DeveloperTool) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*DeveloperTool) RequestDeveloperToolAccessWithCompletionHandler ¶
func (dt *DeveloperTool) RequestDeveloperToolAccessWithCompletionHandler(handler func(bool))
RequestDeveloperToolAccessWithCompletionHandler checks whether developer tool privileges are already available and if not populates an entry in Settings for user approval. This method does not show any UI to the user or guide them towards Settings for approval, if necessary. - Parameter handler: A block called asynchronously with whether the privilege is available. > New info > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func requestAccess() async -> Bool > ``` > > For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/swift/calling-objective-c-apis-asynchronously>.
func (*DeveloperTool) String ¶ added in v0.10.0
func (dt *DeveloperTool) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type DeveloperToolStatus ¶ added in v0.10.0
type DeveloperToolStatus int64
const ( DeveloperToolStatusNotDetermined DeveloperToolStatus = 0 DeveloperToolStatusRestricted DeveloperToolStatus = 1 DeveloperToolStatusDenied DeveloperToolStatus = 2 DeveloperToolStatusAuthorized DeveloperToolStatus = 3 )
func (DeveloperToolStatus) String ¶ added in v0.10.0
func (e DeveloperToolStatus) String() string
String returns the DeveloperToolStatus constant's name, or its numeric form when the value is not a known constant.
type ExecutionPolicy ¶
ExecutionPolicy is an idiomatic wrapper over the Objective-C class EPExecutionPolicy.
func ExecutionPolicyFromID ¶
func ExecutionPolicyFromID(id objc.ID) *ExecutionPolicy
ExecutionPolicyFromID adopts an existing Objective-C object as a ExecutionPolicy (nil for 0), retaining it and registering a release finalizer.
func NewExecutionPolicy ¶
func NewExecutionPolicy() *ExecutionPolicy
NewExecutionPolicy creates a new ExecutionPolicy.
func (*ExecutionPolicy) AddPolicyExceptionForURL ¶ added in v0.10.0
func (ep *ExecutionPolicy) AddPolicyExceptionForURL(url string) error
AddPolicyExceptionForURL adds policy exception for URL.
func (*ExecutionPolicy) Description ¶ added in v0.10.0
func (ep *ExecutionPolicy) Description() string
Description returns the object's -description text.
func (*ExecutionPolicy) IsEqual ¶ added in v0.10.0
func (ep *ExecutionPolicy) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*ExecutionPolicy) IsKind ¶ added in v0.10.0
func (ep *ExecutionPolicy) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*ExecutionPolicy) String ¶ added in v0.10.0
func (ep *ExecutionPolicy) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.