utils

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

*

  • Copyright 2021 Napptive *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • https://www.apache.org/licenses/LICENSE-2.0 *
  • 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

This section is empty.

Variables

This section is empty.

Functions

func GetUserId

func GetUserId() string

GetUserId generates a random UserId

func GetUserName

func GetUserName() string

GetUserName generates a random username

Types

type FullExample

type FullExample struct {
	UserId    string `protobuf:"bytes,1,opt,name=user_id,proto3" json:"user_id,omitempty"`
	Username  string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Cont      int    `protobuf:"bytes,1,opt,name=cont,proto3" json:"con_tab,omitempty"`
	Suspended bool   `protobuf:"bytes,1,opt,name=sus,proto3" json:"suspend,omitempty"`
}

FullExample with a struct to use it in the tests

func NewFullExample

func NewFullExample(userId string, username string, cont int, sus bool) FullExample

NewFullExample returns a filled FullExample

type JsonExample

type JsonExample struct {
	UserId    string `json:"user_id,omitempty"`
	Username  string `json:"username,omitempty"`
	Cont      int    `json:"con_tab,omitempty"`
	Suspended bool   `json:"suspend,omitempty"`
}

JsonExample with a struct with json annotations (no protobuf annotations)

func NewJsonExample

func NewJsonExample(userId string, username string, cont int, sus bool) JsonExample

NewJsonExample returns a struct with json annotations

type NakedExample

type NakedExample struct {
	UserId    string
	Username  string
	Cont      int
	Suspended bool
}

NakedExample defines a struct without annotations

func NewNakedExample

func NewNakedExample(userId string, username string, cont int, sus bool) NakedExample

NewNakedExample returns a struct without annotations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL