Skip to content

Commit

Permalink
Refactor linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
donce committed Jan 30, 2018
1 parent 79c3b5b commit c969681
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/mysterium_client/cli/command.go
Expand Up @@ -204,7 +204,7 @@ func (c *Command) status() {
warn(err)
} else {
info("Status:", status.Status)
info("SID:", status.SessionId)
info("SID:", status.SessionID)
}

statistics, err := c.tequilapi.ConnectionStatistics()
Expand Down
9 changes: 5 additions & 4 deletions tequilapi/client/client.go
Expand Up @@ -23,7 +23,7 @@ type Client struct {
}

// GetIdentities returns a list of client identities
func (client *Client) GetIdentities() (ids []IdentityDto, err error) {
func (client *Client) GetIdentities() (ids []IdentityDTO, err error) {
response, err := client.http.Get("identities", url.Values{})
if err != nil {
return
Expand All @@ -37,7 +37,7 @@ func (client *Client) GetIdentities() (ids []IdentityDto, err error) {
}

// NewIdentity creates a new client identity
func (client *Client) NewIdentity(passphrase string) (id IdentityDto, err error) {
func (client *Client) NewIdentity(passphrase string) (id IdentityDTO, err error) {
payload := struct {
Passphrase string `json:"passphrase"`
}{
Expand Down Expand Up @@ -70,7 +70,7 @@ func (client *Client) RegisterIdentity(address string) (err error) {
}

// Connect initiates a new connection to a host identified by providerID
func (client *Client) Connect(consumerID, providerID string) (status StatusDto, err error) {
func (client *Client) Connect(consumerID, providerID string) (status StatusDTO, err error) {
payload := struct {
Identity string `json:"identity"`
NodeKey string `json:"nodeKey"`
Expand Down Expand Up @@ -119,7 +119,7 @@ func (client *Client) ConnectionStatistics() (statistics StatisticsDTO, err erro
}

// Status returns connection status
func (client *Client) Status() (status StatusDto, err error) {
func (client *Client) Status() (status StatusDTO, err error) {
response, err := client.http.Get("connection", url.Values{})
if err != nil {
return
Expand All @@ -145,6 +145,7 @@ func (client *Client) GetIP() (string, error) {
return ipData.IP, nil
}

// Unlock allows using identity in following commands
func (client *Client) Unlock(identity, passphrase string) error {
path := fmt.Sprintf("identities/%s/unlock", identity)
payload := struct {
Expand Down
12 changes: 6 additions & 6 deletions tequilapi/client/dto.go
@@ -1,9 +1,9 @@
package client

// StatusDto holds connection status and session id
type StatusDto struct {
// StatusDTO holds connection status and session id
type StatusDTO struct {
Status string `json:"status"`
SessionId string `json:"sessionId"`
SessionID string `json:"sessionId"`
}

// StatisticsDTO holds statistics about connection
Expand All @@ -13,12 +13,12 @@ type StatisticsDTO struct {
DurationSeconds int `json:"durationSeconds"`
}

// IdentityDto holds identity address
type IdentityDto struct {
// IdentityDTO holds identity address
type IdentityDTO struct {
Address string `json:"id"`
}

// IdentityList holds returned list of identities
type IdentityList struct {
Identities []IdentityDto `json:"identities"`
Identities []IdentityDTO `json:"identities"`
}

0 comments on commit c969681

Please sign in to comment.