From 08625c6ad782c8085f4fe14370674f0259255f5f Mon Sep 17 00:00:00 2001 From: LordNoteworthy Date: Fri, 14 Jun 2024 16:46:05 +1000 Subject: [PATCH] add service.go --- internal/webapi/service.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 internal/webapi/service.go diff --git a/internal/webapi/service.go b/internal/webapi/service.go new file mode 100644 index 0000000..aa11559 --- /dev/null +++ b/internal/webapi/service.go @@ -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 +}