-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
933eb20
commit 08625c6
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2018 Saferwall. All rights reserved. | ||
// Use of this source code is governed by Apache v2 license | ||
// license that can be found in the LICENSE file. | ||
|
||
package webapi | ||
|
||
const ( | ||
authEndpoint = "/v1/auth/login/" | ||
usersEndpoint = "/v1/users/" | ||
filesEndpoint = "/v1/files/" | ||
) | ||
|
||
type Service struct { | ||
filesURL string | ||
authURL string | ||
usersURL string | ||
} | ||
|
||
// New generates new web apis service object. | ||
func New(baseURL string) Service { | ||
s := Service{} | ||
s.authURL = baseURL + authEndpoint | ||
s.usersURL = baseURL + usersEndpoint | ||
s.filesURL = baseURL + filesEndpoint | ||
return s | ||
} |