voiceit2

package module
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 10 Imported by: 1

README

VoiceIt2-Go travis godoc Go Report Card MIT

A Go wrapper for VoiceIt's API 2.0 featuring Voice + Face Verification and Identification.

Getting Started

Sign up for a free Developer Account at VoiceIt.io. Visit the settings tab to view your API Key and Token.

API calls

You can visit our HTTP API 2.0 Documentation for detailed information on each API call.

Support

Contact us with any questions at support@voiceit.io

License

VoiceIt2-Go is available under the MIT license. See the LICENSE file for more info.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PlatformVersion string = "v2.7.1"
	PlatformId      string = "39"
)

Functions

This section is empty.

Types

type VoiceIt2

type VoiceIt2 struct {
	APIKey          string
	APIToken        string
	BaseUrl         string
	NotificationUrl string
}

func NewClient

func NewClient(key, tok string, customUrl ...string) VoiceIt2

NewClient returns a new VoiceIt2 client

func (*VoiceIt2) AddNotificationUrl

func (vi *VoiceIt2) AddNotificationUrl(notificationUrl string)

AddNotificationUrl adds a notification URL field in the VoiceIt2 object. If one is already specified, it will be overwritten For more details, see https://api.voiceit.io/#webhook-notification

func (VoiceIt2) AddUserToGroup

func (vi VoiceIt2) AddUserToGroup(groupId, userId string) ([]byte, error)

AddUserToGroup takes the groupId generated during a createGroup and the userId generated during createUser and adds the user to the group For more details see https://api.voiceit.io/#add-user-to-group

func (VoiceIt2) CheckGroupExists

func (vi VoiceIt2) CheckGroupExists(groupId string) ([]byte, error)

CheckGroupExists takes the groupId generated during a createGroup and returns whether the group exists for the given groupId For more details see https://api.voiceit.io/#check-if-group-exists

func (VoiceIt2) CheckUserExists

func (vi VoiceIt2) CheckUserExists(userId string) ([]byte, error)

CheckUserExists takes the userId generated during a createUser and returns an object which contains the boolean "exists" which shows whether a given user exists For more details see https://api.voiceit.io/#check-if-a-specific-user-exists

func (VoiceIt2) CreateFaceEnrollment

func (vi VoiceIt2) CreateFaceEnrollment(userId, filePath string, isPhoto ...bool) ([]byte, error)

CreateFaceEnrollment takes the userId generated during a createUser and absolute file path for a video recording to create a face enrollment for the user

func (VoiceIt2) CreateFaceEnrollmentByByteSlice added in v2.6.0

func (vi VoiceIt2) CreateFaceEnrollmentByByteSlice(userId, filename string, fileData []byte, isPhoto ...bool) ([]byte, error)

CreateFaceEnrollmentByByteSlice takes the userId generated during a CreateUser and filename for a video recording to create a face enrollment for the user fileData in []byte form for a video recording to create a face enrollment for the user

func (VoiceIt2) CreateFaceEnrollmentByUrl

func (vi VoiceIt2) CreateFaceEnrollmentByUrl(userId, fileUrl string) ([]byte, error)

CreateFaceEnrollmentByUrl takes the userId generated during a createUser and a fully qualified URL to a video recording to verify the user's face For more details see https://api.voiceit.io/#create-face-enrollment-by-url

func (VoiceIt2) CreateGroup

func (vi VoiceIt2) CreateGroup(description string) ([]byte, error)

CreateGroup creates a new group profile and returns a unique groupId that is used for all future calls related to the group For more details see https://api.voiceit.io/#create-a-group

func (VoiceIt2) CreateManagedSubAccount added in v2.2.0

func (vi VoiceIt2) CreateManagedSubAccount(params structs.CreateSubAccountRequest) ([]byte, error)

CreateManagedSubAccount creates a managed sub-account.

func (VoiceIt2) CreateSplitVideoEnrollment added in v2.5.0

func (vi VoiceIt2) CreateSplitVideoEnrollment(userId, contentLanguage, phrase, audioFilePath, photoFilePath string) ([]byte, error)

CreateSplitVideoEnrollment takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file paths for a photo and audio recording Written for VoiceIt internal projects

func (VoiceIt2) CreateSplitVideoEnrollmentByByteSlice added in v2.6.0

func (vi VoiceIt2) CreateSplitVideoEnrollmentByByteSlice(userId, contentLanguage, phrase, audioFilename, photoFilename string, audioFileData, photoFileData []byte) ([]byte, error)

CreateSplitVideoEnrollmentByByteSlice takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, filename for a photo and audio recording and file data in []byte form for a photo and audio recording Written for VoiceIt internal projects

func (VoiceIt2) CreateUnmanagedSubAccount added in v2.2.0

func (vi VoiceIt2) CreateUnmanagedSubAccount(params structs.CreateSubAccountRequest) ([]byte, error)

CreateUnmanagedSubAccount creates an unmanaged sub-account.

func (VoiceIt2) CreateUser

func (vi VoiceIt2) CreateUser() ([]byte, error)

CreateUser creates a new user profile and returns a unique userId that is used for all future calls related to the user profile For more details see https://api.voiceit.io/#create-a-user

func (VoiceIt2) CreateUserToken

func (vi VoiceIt2) CreateUserToken(userId string, timeout time.Duration) ([]byte, error)

CreateUserToken takes the userId (string) and a timeout (time.Duration). The returned user token can be used to construct a new VoiceIt2 instance which has user level rights for the given user. The timeout controls the expiration of the user token. For more details see https://api.voiceit.io/?go#user-token-generation

func (VoiceIt2) CreateVideoEnrollment

func (vi VoiceIt2) CreateVideoEnrollment(userId, contentLanguage, phrase, filePath string) ([]byte, error)

CreateVideoEnrollment takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for a video recording to create a video enrollment for the user For more details see https://api.voiceit.io/#create-video-enrollment

func (VoiceIt2) CreateVideoEnrollmentByByteSlice added in v2.6.0

func (vi VoiceIt2) CreateVideoEnrollmentByByteSlice(userId, contentLanguage, phrase, filename string, fileData []byte) ([]byte, error)

CreateVideoEnrollmentByByteSlice takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, filename for a video recording to create a video enrollment for the user and file data in []byte form for a video recording to create a video enrollment for the user

func (VoiceIt2) CreateVideoEnrollmentByUrl

func (vi VoiceIt2) CreateVideoEnrollmentByUrl(userId, contentLanguage, phrase, fileUrl string) ([]byte, error)

CreateVideoEnrollmentByUrl takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and a fully qualified URL to a video recording to create a video enrollment for the user For more details see https://api.voiceit.io/#create-video-enrollment-by-url

func (VoiceIt2) CreateVoiceEnrollment

func (vi VoiceIt2) CreateVoiceEnrollment(userId, contentLanguage, phrase, filePath string) ([]byte, error)

CreateVoiceEnrollment takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for an audio recording to create a voice enrollment for the user For more details see https://api.voiceit.io/#create-voice-enrollment

func (VoiceIt2) CreateVoiceEnrollmentByByteSlice added in v2.6.0

func (vi VoiceIt2) CreateVoiceEnrollmentByByteSlice(userId, contentLanguage, phrase, filename string, fileData []byte) ([]byte, error)

CreateVoiceEnrollmentByByteSlice takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, file name for an audio recording to create a voice enrollment for the user file data in []byte form for an audio recording to create a voice enrollment for the user

func (VoiceIt2) CreateVoiceEnrollmentByUrl

func (vi VoiceIt2) CreateVoiceEnrollmentByUrl(userId, contentLanguage, phrase, fileUrl string) ([]byte, error)

CreateVoiceEnrollmentByUrl takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and a fully qualified URL to an audio recording to create a voice enrollment for the user For more details see https://api.voiceit.io/#create-voice-enrollment-by-url

func (VoiceIt2) DeleteAllEnrollments

func (vi VoiceIt2) DeleteAllEnrollments(userId string) ([]byte, error)

DeleteAllEnrollments takes the userId generated during a createUser and deletes all video/voice enrollments for the user For more details see https://api.voiceit.io/#delete-all-enrollments-for-user

func (VoiceIt2) DeleteGroup

func (vi VoiceIt2) DeleteGroup(groupId string) ([]byte, error)

DeleteGroup takes the groupId generated during a createGroup and deletes the group profile disassociates all users associated with it For more details see https://api.voiceit.io/#delete-a-specific-group

func (VoiceIt2) DeleteSubAccount added in v2.2.0

func (vi VoiceIt2) DeleteSubAccount(subAccountAPIKey string) ([]byte, error)

DeleteSubAccount takes a subAccountAPIKey (string).

func (VoiceIt2) DeleteUser

func (vi VoiceIt2) DeleteUser(userId string) ([]byte, error)

DeleteUser takes the userId generated during a createUser and deletes the user profile and all associated face and voice enrollments For more details see https://api.voiceit.io/#delete-a-specific-user

func (VoiceIt2) ExpireUserTokens

func (vi VoiceIt2) ExpireUserTokens(userId string) ([]byte, error)

ExpireUserTokens takes a userId (string). For more details see https://api.voiceit.io/?go#user-token-expiration

func (VoiceIt2) FaceIdentification

func (vi VoiceIt2) FaceIdentification(groupId, filePath string, isPhoto ...bool) ([]byte, error)

FaceIdentification takes the groupId generated during a createGroup, and absolute file path for a face recording to idetify the user's face amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-face

func (VoiceIt2) FaceIdentificationByByteSlice added in v2.6.0

func (vi VoiceIt2) FaceIdentificationByByteSlice(groupId, filename string, fileData []byte, isPhoto ...bool) ([]byte, error)

FaceIdentificationByByteSlice takes the groupId generated during a createGroup, file name for a face recording to idetify the user's face and file data in []byte form for a face recording to idetify the user's face amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-face

func (VoiceIt2) FaceIdentificationByUrl

func (vi VoiceIt2) FaceIdentificationByUrl(groupId, fileUrl string) ([]byte, error)

FaceIdentificationByUrl takes the groupId generated during a createGroup, and a fully qualified URL to a face recording to idetify the user's face amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-face-by-url

func (VoiceIt2) FaceVerification

func (vi VoiceIt2) FaceVerification(userId, filePath string, isPhoto ...bool) ([]byte, error)

FaceVerification takes the userId generated during a createUser and a absolute file path for a video recording to verify the user's face For more details see https://api.voiceit.io/#verify-a-user-s-face

func (VoiceIt2) FaceVerificationByByteSlice added in v2.6.0

func (vi VoiceIt2) FaceVerificationByByteSlice(userId, filename string, fileData []byte, isPhoto ...bool) ([]byte, error)

FaceVerificationByByteSlice takes the userId generated during a createUser and a filename for a video recording to verify the user's face and file data in []byte form for a video recording to verify the user's face

func (VoiceIt2) FaceVerificationByUrl

func (vi VoiceIt2) FaceVerificationByUrl(userId, fileUrl string) ([]byte, error)

FaceVerificationByUrl takes the userId generated during a createUser and a fully qualified URL to a video recording to verify the user's face For more details see https://api.voiceit.io/#verify-a-user-s-face-by-url

func (VoiceIt2) GetAllFaceEnrollments

func (vi VoiceIt2) GetAllFaceEnrollments(userId string) ([]byte, error)

GetAllFaceEnrollments takes the userId generated during a createUser and returns a list of all face enrollments for the user For more details see https://api.voiceit.io/#get-face-enrollments

func (VoiceIt2) GetAllGroups

func (vi VoiceIt2) GetAllGroups() ([]byte, error)

GetAllGroups returns a list of all groups associated with the API Key For more details see https://api.voiceit.io/#get-all-groups

func (VoiceIt2) GetAllUsers

func (vi VoiceIt2) GetAllUsers() ([]byte, error)

GetAllUsers returns a list of all users associated with the API Key For more details see https://api.voiceit.io/#get-all-users

func (VoiceIt2) GetAllVideoEnrollments

func (vi VoiceIt2) GetAllVideoEnrollments(userId string) ([]byte, error)

GetAllVideoEnrollments takes the userId generated during a createUser and returns a list of all video enrollments for the user For more details see https://api.voiceit.io/#get-video-enrollments

func (VoiceIt2) GetAllVoiceEnrollments

func (vi VoiceIt2) GetAllVoiceEnrollments(userId string) ([]byte, error)

GetAllVoiceEnrollments takes the userId generated during a createUser and returns a list of all voice enrollments for the user For more details see https://api.voiceit.io/#get-voice-enrollments

func (VoiceIt2) GetGroup

func (vi VoiceIt2) GetGroup(groupId string) ([]byte, error)

GetGroup takes the groupId generated during a createGroup and returns the group along with a list of associated users in the group For more details see https://api.voiceit.io/#get-a-specific-group

func (VoiceIt2) GetGroupsForUser

func (vi VoiceIt2) GetGroupsForUser(userId string) ([]byte, error)

GetGroupsForUser takes the userId generated during a createUser and returns a list of all groups that the user belongs to For more details see https://api.voiceit.io/#get-groups-for-user

func (VoiceIt2) GetPhrases

func (vi VoiceIt2) GetPhrases(contentLanguage string) ([]byte, error)

GetPhrases takes the contentLanguage For more details see https://api.voiceit.io/#get-phrases

func (VoiceIt2) RegenerateSubAccountAPIToken added in v2.2.0

func (vi VoiceIt2) RegenerateSubAccountAPIToken(subAccountAPIKey string) ([]byte, error)

RegenerateSubAccountAPIToken takes a subAccountAPIKey (string).

func (*VoiceIt2) RemoveNotificationUrl

func (vi *VoiceIt2) RemoveNotificationUrl()

RemoveNotificationUrl removes the notification URL field from the VoiceIt2 struct

func (VoiceIt2) RemoveUserFromGroup

func (vi VoiceIt2) RemoveUserFromGroup(groupId, userId string) ([]byte, error)

RemoveUserFromGroup takes the groupId generated during a createGroup and the userId generated during createUser and removes the user from the group For more details see https://api.voiceit.io/#remove-user-from-group

func (VoiceIt2) SplitVideoIdentification added in v2.5.0

func (vi VoiceIt2) SplitVideoIdentification(groupId, contentLanguage, phrase, audioFilePath, photoFilePath string) ([]byte, error)

SplitVideoIdentification takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for a video recording to idetify the user's face and voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice-amp-face

func (VoiceIt2) SplitVideoIdentificationByByteSlice added in v2.6.0

func (vi VoiceIt2) SplitVideoIdentificationByByteSlice(groupId, contentLanguage, phrase, audioFilename, photoFilename string, audioFileData, photoFileData []byte) ([]byte, error)

SplitVideoIdentificationByByteSlice takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, file name for a video recording to idetify the user's face and voice and file data in []byte form for a video recording to idetify the user's face and voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice-amp-face

func (VoiceIt2) SplitVideoVerification added in v2.5.0

func (vi VoiceIt2) SplitVideoVerification(userId, contentLanguage, phrase, audioFilePath, photoFilePath string) ([]byte, error)

SplitVideoVerification takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file paths for a photo and audio recording to verify the user's face and voice Written for VoiceIt internal projects

func (VoiceIt2) SplitVideoVerificationByByteSlice added in v2.6.0

func (vi VoiceIt2) SplitVideoVerificationByByteSlice(userId, contentLanguage, phrase, audioFilename, photoFilename string, audioFileData, photoFileData []byte) ([]byte, error)

SplitVideoVerificationByByteSlice takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, file names for a photo and audio recording to verify the user's face and voice and file data in []byte form for a photo and audio recording to verify the user's face and voice

func (VoiceIt2) SwitchSubAccountType added in v2.3.0

func (vi VoiceIt2) SwitchSubAccountType(subAccountAPIKey string) ([]byte, error)

SwitchSubAccountType takes a subAccountAPIKey (string) (

func (VoiceIt2) VideoIdentification

func (vi VoiceIt2) VideoIdentification(groupId, contentLanguage, phrase, filePath string) ([]byte, error)

VideoIdentification takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for a video recording to idetify the user's face and voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice-amp-face

func (VoiceIt2) VideoIdentificationByByteSlice added in v2.6.0

func (vi VoiceIt2) VideoIdentificationByByteSlice(groupId, contentLanguage, phrase, filename string, fileData []byte) ([]byte, error)

VideoIdentificationByByteSlice takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, file name for a video recording to idetify the user's face and voice and file data in []byte form for a video recording to idetify the user's face and voice amongst others in the group

func (VoiceIt2) VideoIdentificationByUrl

func (vi VoiceIt2) VideoIdentificationByUrl(groupId, contentLanguage, phrase, fileUrl string) ([]byte, error)

VideoIdentificationByUrl takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and a fully qualified URL to a video recording to idetify the user's face and voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice-amp-face-by-url

func (VoiceIt2) VideoVerification

func (vi VoiceIt2) VideoVerification(userId, contentLanguage, phrase, filePath string) ([]byte, error)

VideoVerification takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for a video recording to verify the user's face and voice For more details see https://api.voiceit.io/#video-verification

func (VoiceIt2) VideoVerificationByByteSlice added in v2.6.0

func (vi VoiceIt2) VideoVerificationByByteSlice(userId, contentLanguage, phrase, filename string, fileData []byte) ([]byte, error)

VideoVerificationByByteSlice takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and filename for a video recording to verify the user's face and voice and file data in []byte form for a video recording to verify the user's face and voice

func (VoiceIt2) VideoVerificationByUrl

func (vi VoiceIt2) VideoVerificationByUrl(userId, contentLanguage, phrase, fileUrl string) ([]byte, error)

VideoVerificationByUrl takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and a fully qualified URL to a video recording to verify the user's face and voice For more details see https://api.voiceit.io/#video-verification-by-url

func (VoiceIt2) VoiceIdentification

func (vi VoiceIt2) VoiceIdentification(groupId, contentLanguage, phrase, filePath string) ([]byte, error)

VoiceIdentification takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for an audio recording to idetify the user's voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice

func (VoiceIt2) VoiceIdentificationByByteSlice added in v2.6.0

func (vi VoiceIt2) VoiceIdentificationByByteSlice(groupId, contentLanguage, phrase, filename string, fileData []byte) ([]byte, error)

VoiceIdentificationByByteSlice takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, file name for an audio recording to idetify the user's voice and file data in []byte form for an audio recording to idetify the user's voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice

func (VoiceIt2) VoiceIdentificationByUrl

func (vi VoiceIt2) VoiceIdentificationByUrl(groupId, contentLanguage, phrase, fileUrl string) ([]byte, error)

VoiceIdentificationByUrl takes the groupId generated during a createGroup, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and a fully qualified URL to an audio recording to idetify the user's voice amongst others in the group For more details see https://api.voiceit.io/#identify-a-user-s-voice-by-url

func (VoiceIt2) VoiceVerification

func (vi VoiceIt2) VoiceVerification(userId, contentLanguage, phrase, filePath string) ([]byte, error)

VoiceVerification takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and absolute file path for an audio recording to verify the user's voice For more details see https://api.voiceit.io/#verify-a-user-s-voice

func (VoiceIt2) VoiceVerificationByByteSlice added in v2.6.0

func (vi VoiceIt2) VoiceVerificationByByteSlice(userId, contentLanguage, phrase, filename string, fileData []byte) ([]byte, error)

VoiceVerificationByByteSlice takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, filename for an audio recording to verify the user's voice and file data in []byte form for an audio recording to verify the user's voice

func (VoiceIt2) VoiceVerificationByUrl

func (vi VoiceIt2) VoiceVerificationByUrl(userId, contentLanguage, phrase, fileUrl string) ([]byte, error)

VoiceVerificationByUrl takes the userId generated during a createUser, the contentLanguage(https://api.voiceit.io/#content-languages) for the phrase, the text of a valid phrase for the developer account, and a fully qualified URL to an audio recording to verify the user's voice For more details see https://api.voiceit.io/#verify-a-user-s-voice-by-url

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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