slantview.com

Tech Shit.

about me

I am a Senior Software Engineer at Riot Games. These thoughts are my own and not of my employer.

recent public projects

Status updating…

found on

First Post

- - posted in tech, test

Hello and welcome to my new Octopress blog.

Test Code block:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
func (c *Client) NewDropletRequest(name string) *DropletRequest {
    dr := &DropletRequest{
        Name:              name,
        Region:            DefaultRegionSlug,
        Size:              DefaultSizeSlug,
        Image:             DefaultImageSlug,
        Backups:           false,
        IPv6:              false,
        PrivateNetworking: false,
        UserData:          "",
    }

    return dr
}

func (c *Client) CreateDroplet(request *DropletRequest) (*Droplet, error) {
    var dropletResponse DropletResponse

    apiErr := c.Post("droplets", request, &dropletResponse, nil)
    if apiErr != nil {
        return nil, errors.New(fmt.Sprintf("API Error: %s", apiErr.Message))
    }

    return dropletResponse.Droplet, nil
}