util

package
v0.0.0-...-c7b2723 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertIDFromAddress

func ConvertIDFromAddress(prefName string) int

ConvertIDFromAddress 文字列から都道府県判別する

func ConvertIDIntoInt64

func ConvertIDIntoInt64(ID interface{}) (int64, error)

ConvertIDIntoInt64 文字列をint64に変換する

func CopyStruct

func CopyStruct(src interface{}, dst interface{}) error

CopyStruct 構造体をコピーする。変数名と型で判定している。

func CreateLinkHeader

func CreateLinkHeader(reqData *goa.RequestData, scheme string, cursor string) linkheader.Link

CreateLinkHeader レスポンスヘッダのLinkに付加するページングリンク情報を作成する

func CreateTokenHash

func CreateTokenHash(str string) string

CreateTokenHash 渡された文字列とsaltからTokenハッシュを生成する

func DelimiterByCharCon

func DelimiterByCharCon(delimiter string, strs ...string) string

DelimiterByCharCon 指定区切り文字でも字を連結する

func FetchAPIresponse

func FetchAPIresponse(client *http.Client, url string, dest interface{}) error

FetchAPIresponse 外部APIのレスポンス(json)をdestに入れる

func FormatAddress

func FormatAddress(address string) string

FormatAddress 住所情報の整形をする さらに情報が増えたら配列で引数を取る

func GenHashFromString

func GenHashFromString(str string) string

GenHashFromString 文字列からハッシュを生成する

func GetAreaFromAddress

func GetAreaFromAddress(address string) string

GetAreaFromAddress 住所から市区町村までを取得する

func GetUserKey

func GetUserKey(ctx context.Context) (*datastore.Key, error)

GetUserKey Contextに入っているUserKeyを取り出す

func ReadFileFromBucket

func ReadFileFromBucket(ctx context.Context, path string) ([]byte, error)

ReadFileFromBucket GCP上のStorageにアクセスしてデータも返す

func RemoveDuplicateInt64

func RemoveDuplicateInt64(args []int64) []int64

nolint

func RemovePoscode

func RemovePoscode(str string) string

RemovePoscode 郵便番号削除

func RemoveSpace

func RemoveSpace(str string) string

RemoveSpace 無駄なスペースを削除する

func SetUserKey

func SetUserKey(parents context.Context, userKey *datastore.Key) context.Context

SetUserKey ContextにUserKeyを格納する

Types

type ContextKey

type ContextKey string

ContextKey Contextのキーを扱うためのstring

const (
	ContextUserKey ContextKey = "userKey"
)

Context内の値にアクセスするための定数キー

Jump to

Keyboard shortcuts

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