memfault

package
v0.0.0-...-7f97a8c Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	APIKey string `json:"api_key,omitempty"`
}

APIKey provides the apikey

type Cohort

type Cohort struct {
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

Cohort struct

type CohortData

type CohortData struct {
	ByPassPrimarySoftwareTypeCheck bool      `json:"bypass_primary_software_type_check,omitempty"`
	ByPassVersionChecks            bool      `json:"bypass_version_checks,omitempty"`
	CountActiveDeployments         int       `json:"count_active_deployments,omitempty"`
	CountDevices                   int       `json:"count_devices,omitempty"`
	CountStagedDevices             int       `json:"count_staged_devices,omitempty"`
	CreatedDate                    time.Time `json:"created_date,omitempty"`
	ID                             int       `json:"id,omitempty"`
	IgnoreTraces                   bool      `json:"ignore_traces,omitempty"`
	LastDeployment                 time.Time `json:"last_deployment,omitempty"`
	Name                           string    `json:"name,omitempty"`
	ReturnEqualLatestReleases      bool      `json:"return_equal_latest_releases,omitempty"`
	Slug                           string    `json:"slug,omitempty"`
	UpdatedDate                    time.Time `json:"updated_date,omitempty"`
	UpdatesEnabled                 bool      `json:"updates_enabled,omitempty"`
}

CohortData struct

type Config

type Config struct {
	APIURL      string
	ChunksURL   string
	IngressURL  string
	FilesURL    string
	Credentials Credentials

	MaxIdleConns    int
	IdleConnTimeout time.Duration
}

Config contains sdk configuration parameters.

type ContentType

type ContentType string

ContentType represents all possible content types.

type CreateCohortRes

type CreateCohortRes struct {
	Data CohortData `json:"data,omitempty"`
}

CreateCohortRes struct

type CreateProjectRes

type CreateProjectRes struct {
	Data projectData `json:"data,omitempty"`
}

CreateProjectRes thirs is a new project created

type Credentials

type Credentials struct {
	Email             string `json:"email"`
	Password          string `json:"password"`
	APIKey            string `json:"api_key"`
	OrganisationToken string `json:"organisation_token"`
	ProjectKey        string `json:"project_key"`
}

Credentials contains the credentials

type ErrorRes

type ErrorRes struct {
	Error errorInformation `json:"error,omitempty"`
}

ErrorRes eror message that project already exist

type ListCohortRes

type ListCohortRes struct {
	Data []CohortData `json:"data,omitempty"`
}

ListCohortRes struct

type ListProjectRes

type ListProjectRes struct {
	Data   []projectData `json:"data,omitempty"`
	Paging paging        `json:"paging,omitempty"`
}

ListProjectRes struct

type Project

type Project struct {
	Name     string `json:"name"`
	Slug     string `json:"slug"`
	Os       string `json:"os"`
	Platform string `json:"platform"`
}

Project struct

type SDK

type SDK interface {
	// GetMe Return information about the logged in User
	GetMe() (UserRes, error)

	// Generate a user api key
	GenerateUserAPIKey() (UserAPIKeyRes, error)

	// Get a previously generated API Key for the logged in User
	GetUserAPIKey() (UserAPIKeyRes, error)

	// Invalidate the previously generated API Key for the logged in User and do not create another one
	DeleteUserAPIKey() (string, error)

	// Creates a Project under the given Organization
	CreateProject(project Project) (CreateProjectRes, error)

	// List the Projects under a given Organization
	ListProject() (ListProjectRes, error)

	// Retrieves a Project under a given Organization
	RetrieveProject(projectSlug string) (CreateProjectRes, error)

	// Update a Project under a given Organization
	UpdateProject(project Project) (CreateProjectRes, error)

	// Delete a Project under a given Organization
	DeleteProject(project Project) (string, error)

	// Return the Project Client Key
	GetProjectClientKey(projectSlug string) (UserAPIKeyRes, error)

	// Regenerate the Project Client Key
	RefreshProjectClientKey(projectSlug string) (UserAPIKeyRes, error)

	CreateCohort(project Project, cohort Cohort) (CreateCohortRes, error)

	ListCohorts(project Project) (ListCohortRes, error)

	RetrieveCohorts(project Project, cohort Cohort) (CreateCohortRes, error)

	UpdateCohorts(project Project, cohort Cohort, cohortslug string) (CreateCohortRes, error)

	DeleteCohorts(project Project, cohort Cohort) (string, error)
}

SDK contains Mainflux API.

func NewSDK

func NewSDK(conf Config) SDK

NewSDK returns new mainflux SDK instance.

type UserAPIKeyRes

type UserAPIKeyRes struct {
	Data APIKey `json:"data,omitempty"`
}

UserAPIKeyRes is information about the logged in user api key

type UserRes

type UserRes struct {
	CreatedDate       time.Time         `json:"created_date,omitempty"`
	Email             string            `json:"email,omitempty"`
	ID                int               `json:"id,omitempty"`
	Name              string            `json:"name,omitempty"`
	Organizations     []organization    `json:"organizations,omitempty"`
	UpdatedDate       time.Time         `json:"updated_date,omitempty"`
	PrivacyNotice     bool              `json:"has_accepted_privacy_notice,omitempty"`
	TermsOfService    bool              `json:"has_accepted_terms_of_service,omitempty"`
	Impersonated      string            `json:"impersonator,omitempty"`
	OrganizationsAcls []organizationACL `json:"organization_acls,omitempty"`
}

UserRes is information about the logged in User

Jump to

Keyboard shortcuts

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