Documentation
¶
Index ¶
- Constants
- Variables
- type Devices
- type GenericResponse
- type GetOptions
- type KeystoneClient
- type KeystoneClientImpl
- func (client *KeystoneClientImpl) Devices() *Devices
- func (client *KeystoneClientImpl) Messages() *Messages
- func (client *KeystoneClientImpl) Organizations() *Organizations
- func (client *KeystoneClientImpl) Project(projectId string) *Project
- func (client *KeystoneClientImpl) Roles() *Roles
- func (client *KeystoneClientImpl) Users() *Users
- type Messages
- type Organizations
- func (c *Organizations) CreateOrganization(organizationName string, private bool) (models.Organization, error)
- func (c *Organizations) GetAll() ([]models.Organization, error)
- func (c *Organizations) GetByName(name string, owned GetOptions) (models.Organization, error)
- func (c *Organizations) GetManagementUrl(organizationName string) (url string, err error)
- func (c *Organizations) GetMembers(orga models.Organization) ([]models.ProjectMember, error)
- func (c *Organizations) GetProjects(orga models.Organization) ([]models.Project, error)
- func (c *Organizations) GetUpgradeUrl(organizationName string) (url string, err error)
- func (c *Organizations) UpdateOrganization(organization models.Organization) (models.Organization, error)
- type Project
- func (p *Project) AddMembers(memberRoles map[string]models.Role) error
- func (p *Project) Destroy() (err error)
- func (p *Project) GetAccessibleEnvironments() ([]models.Environment, error)
- func (p *Project) GetAll() ([]models.Project, error)
- func (p *Project) GetAllMembers() ([]models.ProjectMember, error)
- func (p *Project) GetLogs(options *models.GetLogsOptions) ([]models.ActivityLogLite, error)
- func (p *Project) GetProjectsOrganization() (models.Organization, error)
- func (p *Project) GetRoles() ([]models.Role, error)
- func (p *Project) Init(name string, organizationID uint) (models.Project, error)
- func (p *Project) IsOrganizationPaid() (bool, error)
- func (p *Project) RemoveMembers(members []string) error
- func (p *Project) SetMemberRole(memberId string, role string) (err error)
- type Roles
- type Users
- func (u *Users) CheckUsersExist(userIds []string) (models.CheckMembersResponse, error)
- func (u *Users) GetEnvironmentPublicKeys(environmentId string) (models.PublicKeys, error)
- func (u *Users) GetUserKeys(userID string) (result models.UserDevices, err error)
- func (u *Users) InviteUser(userEmail string, projectName string) (result models.GetInviteResponse, err error)
Constants ¶
const ( GET methodType = "GET" POST methodType = "POST" PUT methodType = "PUT" DELETE methodType = "DELETE" )
Variables ¶
var ApiURL string //= "http://localhost:9001"
Functions ¶
This section is empty.
Types ¶
type Devices ¶
type Devices struct {
// contains filtered or unexported fields
}
type GenericResponse ¶
type GetOptions ¶
type GetOptions bool
const ( OWNED_ONLY GetOptions = true ALL_KNWON GetOptions = false )
type KeystoneClient ¶
type KeystoneClient interface {
Project(projectId string) *Project
Roles() *Roles
Users() *Users
Messages() *Messages
Devices() *Devices
Organizations() *Organizations
}
func NewKeystoneClient ¶
func NewKeystoneClient() (KeystoneClient, *errors.Error)
NewKeystoneClient function returns a new instance of KeysotneClient
type KeystoneClientImpl ¶
type KeystoneClientImpl struct {
// contains filtered or unexported fields
}
func (*KeystoneClientImpl) Devices ¶
func (client *KeystoneClientImpl) Devices() *Devices
Devices method returns an interface to interact with devices
func (*KeystoneClientImpl) Messages ¶
func (client *KeystoneClientImpl) Messages() *Messages
Messages method returns an interface to interact with messages
func (*KeystoneClientImpl) Organizations ¶
func (client *KeystoneClientImpl) Organizations() *Organizations
Organizations method returns an interfaec to interact with organizations
func (*KeystoneClientImpl) Project ¶
func (client *KeystoneClientImpl) Project(projectId string) *Project
Project method returns an interface to interact with projects
func (*KeystoneClientImpl) Roles ¶
func (client *KeystoneClientImpl) Roles() *Roles
Roles method returns an interface to interact with roles
func (*KeystoneClientImpl) Users ¶
func (client *KeystoneClientImpl) Users() *Users
Users method returns an interface to interact with users/members
type Messages ¶
type Messages struct {
// contains filtered or unexported fields
}
func (*Messages) DeleteMessage ¶
func (client *Messages) DeleteMessage(messageID uint) (GenericResponse, error)
DeleteMessage method deletes the message
func (*Messages) GetMessages ¶
func (client *Messages) GetMessages( projectID string, ) (models.GetMessageByEnvironmentResponse, error)
GetMessages method gets all messages for the users device, regarding the current project
func (*Messages) SendMessages ¶
func (client *Messages) SendMessages( messages models.MessagesToWritePayload, ) (models.GetEnvironmentsResponse, error)
SendMessages method sends messages to members of the project
type Organizations ¶
type Organizations struct {
// contains filtered or unexported fields
}
func (*Organizations) CreateOrganization ¶
func (c *Organizations) CreateOrganization( organizationName string, private bool, ) (models.Organization, error)
CreateOrganization method creates a new organization
func (*Organizations) GetAll ¶
func (c *Organizations) GetAll() ([]models.Organization, error)
GetAll method returns all the organizations the user is a member of
func (*Organizations) GetByName ¶
func (c *Organizations) GetByName( name string, owned GetOptions, ) (models.Organization, error)
GetByName method returns the organiziation withe the name `name`. Set `owned` to `OWNED_ONLY` to only search among the organizations owned by the user. Set it to `ALL_KNWON` to search among all the organizations the user is a member of.
func (*Organizations) GetManagementUrl ¶
func (c *Organizations) GetManagementUrl( organizationName string, ) (url string, err error)
GetManagementUrl returns an URL to a service that manages an existing subscription for the named organization To be called to update payment method or cancel an existing plan
func (*Organizations) GetMembers ¶
func (c *Organizations) GetMembers( orga models.Organization, ) ([]models.ProjectMember, error)
GetMembers method returns all the members having access to the organization
func (*Organizations) GetProjects ¶
func (c *Organizations) GetProjects( orga models.Organization, ) ([]models.Project, error)
GetProjects method returns all the projects that belong to the organization
func (*Organizations) GetUpgradeUrl ¶
func (c *Organizations) GetUpgradeUrl( organizationName string, ) (url string, err error)
GetUpgradeUrl returns an URL to a service that creates a new subscription for the named organization To be called to turn a non-paid organization into a paid one
func (*Organizations) UpdateOrganization ¶
func (c *Organizations) UpdateOrganization( organization models.Organization, ) (models.Organization, error)
UpdateOrganization method updates (renames) an organizaiton
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
func (*Project) AddMembers ¶
Add members to a project
func (*Project) Destroy ¶
Destroys the project, its environments, environments versions, project members, messages, etc. Permanently
func (*Project) GetAccessibleEnvironments ¶
func (p *Project) GetAccessibleEnvironments() ([]models.Environment, error)
GetAccessibleEnvironments method returns the list of environments the current user is allowed access to.
func (*Project) GetAll ¶
GetAll method returns a list of all the projects the current user is associated with
func (*Project) GetAllMembers ¶
func (p *Project) GetAllMembers() ([]models.ProjectMember, error)
GetAllMembers method returns all members associated with the project
func (*Project) GetLogs ¶
func (p *Project) GetLogs( options *models.GetLogsOptions, ) ([]models.ActivityLogLite, error)
GetLogs method returns all the logs relative to the current project
func (*Project) GetProjectsOrganization ¶
func (p *Project) GetProjectsOrganization() (models.Organization, error)
GetProjectsOrganization method fetches the organziation this project belongs to
func (*Project) IsOrganizationPaid ¶
IsOrganizationPaid method returns true if the organization the project belongs to is paid
func (*Project) RemoveMembers ¶
Removes members from the project (from all environments)
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func (*Users) CheckUsersExist ¶
func (u *Users) CheckUsersExist( userIds []string, ) (models.CheckMembersResponse, error)
CheckUsersExist method check the existence of the users given in `userIds` These are Keystone userIds: `member@service`
func (*Users) GetEnvironmentPublicKeys ¶
func (u *Users) GetEnvironmentPublicKeys( environmentId string, ) (models.PublicKeys, error)
GetEnvironmentPublicKeys method get the public keys of all the devices that have a read access to the environment
func (*Users) GetUserKeys ¶
func (u *Users) GetUserKeys( userID string, ) (result models.UserDevices, err error)
GetUserKeys method returns the public key of a specific user
func (*Users) InviteUser ¶
func (u *Users) InviteUser( userEmail string, projectName string, ) (result models.GetInviteResponse, err error)
InviteUser method sends a Keystone invitation mail