userutil

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package userutil provides functions that help with management of users

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDeviceOwner

func CreateDeviceOwner(ctx context.Context, username, password string, extraOpts ...chrome.Option) error

CreateDeviceOwner creates a user like the CreateUser function, but before closing the session it waits until the user becomes device owner.

func CreateUser

func CreateUser(ctx context.Context, username, password string, extraOpts ...chrome.Option) error

CreateUser creates a new session with a given name and password, considering extra options. It immediately closes the session, so it should be used only for creating new users, not logging in.

func GetKnownEmailsFromLocalState

func GetKnownEmailsFromLocalState() (map[string]bool, error)

GetKnownEmailsFromLocalState returns a map of users that logged in on the device, based on the LoggedInUsers from the LocalState file.

func Login

func Login(ctx context.Context, username, password string) (*chrome.Chrome, error)

Login creates a new user session using provided credentials. If the user doesn't exist it creates a new one. It always keeps the current state, and doesn't support other options.

func WaitForOwnership

func WaitForOwnership(ctx context.Context, cr *chrome.Chrome) error

WaitForOwnership waits for up to 20 seconds for the current user to become device owner. Normally this should take less then a few seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL