Documentation ¶
Overview ¶
Package api contains the REST and gRPC API.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func ServeStaticFile(mux *http.ServeMux)
- func ServeSwagger(mux *http.ServeMux)
- func VersionHandler(w http.ResponseWriter, r *http.Request)
- type HealthService
- type InfoService
- type Service
- type UrlService
- func (ls *UrlService) Create(ctx context.Context, request *v2beta.CreateUrlRequest) (*v2beta.CreateUrlResponse, error)
- func (ls *UrlService) Get(ctx context.Context, request *v2beta.GetUrlRequest) (*v2beta.GetUrlResponse, error)
- func (ls *UrlService) List(ctx context.Context, request *v2beta.GetUrlsRequest) (*v2beta.GetUrlsResponse, error)
- func (service *UrlService) Register()
- type VersionResponse
Constants ¶
View Source
const (
UrlServiceName = "UrlService"
)
Variables ¶
View Source
var (
Services = []string{}
)
Functions ¶
func ServeSwagger ¶
ServeSwagger expose files in third_party/swagger-ui/ on <host>/swagger-ui
func VersionHandler ¶
func VersionHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type HealthService ¶
type HealthService struct { Authentication auth.Authentication HealthUser string HealthKey string URI string Services []string }
func NewHealthService ¶
func NewHealthService(conf *config.Configuration, uri string, services []string) (*HealthService, error)
func (*HealthService) Status ¶
func (service *HealthService) Status(ctx context.Context, req *health.StatusRequest) (*health.StatusResponse, error)
type InfoService ¶
type InfoService struct {
Version string
}
func NewInfoService ¶
func NewInfoService(conf *config.Configuration) *InfoService
func (*InfoService) Get ¶
func (service *InfoService) Get(ctx context.Context, req *info.GetInfoRequest) (*info.GetInfoResponse, error)
type UrlService ¶
func NewUrlService ¶
func NewUrlService(storage storage.Storage) *UrlService
func (*UrlService) Create ¶
func (ls *UrlService) Create(ctx context.Context, request *v2beta.CreateUrlRequest) (*v2beta.CreateUrlResponse, error)
func (*UrlService) Get ¶
func (ls *UrlService) Get(ctx context.Context, request *v2beta.GetUrlRequest) (*v2beta.GetUrlResponse, error)
func (*UrlService) List ¶
func (ls *UrlService) List(ctx context.Context, request *v2beta.GetUrlsRequest) (*v2beta.GetUrlsResponse, error)
func (*UrlService) Register ¶
func (service *UrlService) Register()
type VersionResponse ¶
type VersionResponse struct {
Version string `json:"version"`
}
Click to show internal directories.
Click to hide internal directories.