// history executes tiller.GetHistory RPC.
197147
func (h *Client) history(ctx context.Context, req *rls.GetHistoryRequest) (*rls.GetHistoryResponse, error) {
	c, err := h.connect(ctx)
	if err != nil {
		return nil, err
	}
	defer c.Close()

	rlc := rls.NewReleaseServiceClient(c)
	return rlc.GetHistory(ctx, req)
}
763787
func (h *HistoryProvider) Go(path string) {
	if h.usingHash {
		SetDOMHash(path)
		return
	}
	PushDOMState(path)
}
1367792
func OptionHistory(x []string) Option {
	return func(p *Prompt) error {
		p.history.histories = x
		p.history.Clear()
		return nil
	}
}
716957
func (_m *APIClient) ImageHistory(ctx context.Context, _a1 string) ([]image.HistoryResponseItem, error) {
	ret := _m.Called(ctx, _a1)

	var r0 []image.HistoryResponseItem
	if rf, ok := ret.Get(0).(func(context.Context, string) []image.HistoryResponseItem); ok {
		r0 = rf(ctx, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]image.HistoryResponseItem)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = rf(ctx, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1206001
func (s *AlarmHistoryItem) SetHistoryData(v string) *AlarmHistoryItem {
	s.HistoryData = &v
	return s
}
711761
func (tm *TrustMetric) HistoryJSON() MetricHistoryJSON {
	tm.mtx.Lock()
	defer tm.mtx.Unlock()

	return MetricHistoryJSON{
		NumIntervals: tm.numIntervals,
		History:      tm.history,
	}
}
648176
func WithMaxHistory(max int32) HistoryOption {
	return func(opts *options) {
		opts.histReq.Max = max
	}
}
1059391
func (r *Session) GetRemoteHistory(imgID, registry string) ([]string, error) {
	res, err := r.client.Get(registry + "images/" + imgID + "/ancestry")
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	if res.StatusCode != 200 {
		if res.StatusCode == 401 {
			return nil, errcode.ErrorCodeUnauthorized.WithArgs()
		}
		return nil, newJSONError(fmt.Sprintf("Server error: %d trying to fetch remote history for %s", res.StatusCode, imgID), res)
	}

	var history []string
	if err := json.NewDecoder(res.Body).Decode(&history); err != nil {
		return nil, fmt.Errorf("Error while reading the http response: %v", err)
	}

	logrus.Debugf("Ancestry: %v", history)
	return history, nil
}
940399
func PrettyHistoryEvent(h *swf.HistoryEvent) string {
	var buffer bytes.Buffer
	buffer.WriteString("HistoryEvent{ ")
	if h.EventId != nil {
		buffer.WriteString(fmt.Sprintf("EventId: %d,", *h.EventId))
	}
	if h.EventTimestamp != nil {
		buffer.WriteString(fmt.Sprintf("EventTimestamp: %s, ", *h.EventTimestamp))
	}
	if h.EventType != nil {
		buffer.WriteString(fmt.Sprintf("EventType: %s,", *h.EventType))
	}
	buffer.WriteString(fmt.Sprintf(" %+v", eventTypes[*h.EventType](h)))
	buffer.WriteString(" }")
	return buffer.String()
}
1221659
func (uh *UserHistory) UpdateHistory(
	tlfName tlf.CanonicalName, tlfType tlf.Type, tlfHistory *TlfHistory,
	loggedInUser string) {
	uh.vlog.CLogf(nil, libkb.VLog1, "Updating user history for TLF %s, "+
		"user %s", tlfName, loggedInUser)
	history := tlfHistory.getHistory(loggedInUser)
	key := tlfKey{tlfName, tlfType}

	uh.lock.Lock()
	defer uh.lock.Unlock()
	uh.histories[key] = history
}
421876
func ImageHistory(id string) (histories []image.HistoryResponseItem, err error) {
	var (
		ctx context.Context
		cli *client.Client
	)
	if ctx, cli, err = mgr.Client(); err == nil {
		return cli.ImageHistory(ctx, id)
	}
	return
}
1288693
func (w *walletAPIHandler) history(ctx context.Context, c Call, wr io.Writer) error {
	var opts accountIDOptions
	if err := unmarshalOptions(c, &opts); err != nil {
		return w.encodeErr(c, err, wr)
	}
	a := opts.Convert()
	payments, err := w.cli.RecentPaymentsCLILocal(ctx, &a)
	if err != nil {
		return w.encodeErr(c, err, wr)
	}
	return w.encodeResult(c, payments, wr)
}
236519
func (uh *UserHistory) GetTlfHistory(
	tlfName tlf.CanonicalName, tlfType tlf.Type) (
	history keybase1.FSFolderEditHistory) {
	uh.lock.RLock()
	defer uh.lock.RUnlock()
	return uh.getTlfHistoryLocked(tlfName, tlfType)
}
1246437
func (c *FakeClient) ReleaseHistory(rlsName string, opts ...HistoryOption) (*rls.GetHistoryResponse, error) {
	return &rls.GetHistoryResponse{Releases: c.Rels}, nil
}
465894
func (his *MemoryHistory) Push(p *State) int {
	his.list.PushFront(p)

	// Trim history if maxHist is set
	if his.maxHist > 0 {
		if l := his.list.Len(); l > his.maxHist {
			for i := 0; i < l-his.maxHist; i++ {
				his.list.Remove(his.list.Back())
			}
		}
	}
	return his.list.Len()
}
389531
func (h *Client) ReleaseHistory(rlsName string, opts ...HistoryOption) (*rls.GetHistoryResponse, error) {
	reqOpts := h.opts
	for _, opt := range opts {
		opt(&reqOpts)
	}

	req := &reqOpts.histReq
	req.Name = rlsName
	ctx := NewContext()

	if reqOpts.before != nil {
		if err := reqOpts.before(ctx, req); err != nil {
			return nil, err
		}
	}
	return h.history(ctx, req)
}
240629
func (e *JSONEncoder) EncodeHistoryRemove(res *HistoryRemoveResult) ([]byte, error) {
	return json.Marshal(res)
}